atan
The angle whose tangent is your number
- value
- FLOAT
Find the angle from a slope
Tangent is rise over run; arctangent is the reverse - give it the slope and it returns the angle. atan(1) gives you 45°, because a slope of 1 is a 45° rise. It's the trig function you want when you have a ratio (not a pair of coordinates - that's atan2's job) and need the angle that produced it.
It's the friendlier member of the pack's inverse-trig trio: unlike asin and acos, atan accepts any real number, no domain restrictions. Input -1 to 1, input 1000, doesn't matter - you always get a valid angle out. That makes it the one you can wire into a workflow without defensive clamping.
How it works
The node computes atan(value) and converts to degrees if that unit is selected (the default). Output range is -90° to 90° (or -π/2 to π/2 in radians) - the half-circle range that defines arctangent. One thing to remember: because a slope doesn't encode direction, atan(1) can't tell you whether the angle is 45° or 225°. For direction-aware angles you need both coordinates, which is exactly what the pack's atan2 node is for.
The value input is a text field that takes a plain number (it's float()-parsed) - 1.0 or -0.75 are fine, "1/1" is not. Wire another node's output in if the value is computed.
Inputs and outputs
- value (FLOAT or INT, default
0) - the slope, any real number. - unit (enum, default
degrees) -radiansordegreesfor the output.
Output is a single FLOAT: the angle whose tangent is the input.
Installing it
Ships in Basic data handling by StableLlama, the r/StableDiffusion regular whose long model comparisons (Flux Klein 9B, RealVisXL) are more famous than his code. The pack is featherweight by design - zero runtime dependencies, no model downloads, nothing that can break your environment.
Install via ComfyUI Manager (search "Basic data handling") or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart ComfyUI; it's under Basic/maths.
Troubleshooting
About the only way to misuse this is to feed it a single value when you actually have x and y coordinates and want a quadrant-aware angle - that's atan2, two doors down in the same category. And as with every node in this math family, if the answer looks wrong by a factor of ~57, you've got the unit dropdown set to radians when you meant degrees.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT,INT | 0 | — |
| unit | COMBO | degrees | 2 options: radians, degrees |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |