atan

atan(x)

Try it yourself:

See also:

atan(): Recovering an Angle from a Tangent

atan() returns the principal angle whose tangent equals the input. It reverses tan() on the interval from −π/2 to π/2. atan is common when a slope or a ratio of vertical to horizontal change must be turned into an angle.

Examples and limits

atan(0) is 0; positive inputs return positive angles and negative inputs return negative angles. Every finite real number is valid, but the output approaches ±π/2 as magnitude increases and never reaches those values for finite input. This makes atan useful for smoothly mapping an unbounded quantity into a bounded angular range.

For a slope m, atan(m) gives the angle from the horizontal. However, a slope alone loses quadrant information and cannot represent a vertical line. If you have separate y and x components, use atan2() instead. It handles signs and zero components directly.

Working with other inverse functions

Use asin() for a sine ratio and acos() for a cosine ratio. Verify a result with tan(atan(x)), allowing for normal floating-point precision. Keep values in radians when combining them with sin() or cos().

In numerical code, avoid calculating atan(y/x) when x may be zero or very small. atan2 is designed for that case and communicates the intended geometry more clearly.

Try Atan in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions