Function reference · Trigonometry

atan2

Returns the angle of the point (x, y), in radians from -π to π.

Unlike atan(y/x), it uses the signs of both coordinates, so it knows which quadrant the point is in. Note the order: atan2(y, x).

Notation

atan2(y, x)

Write it in an expression: nerdamer('atan2(1,1)'), or in the Playground.

nerdamer.atan2

nerdamer.atan2(y: ExpressionInput, x: ExpressionInput): Expression

A method on the default import. Arguments can be strings, as in Notation.

Examples

First quadrant.

atan2(1,1)
// → (1/4)*pi
Open in Playground

Third quadrant, which atan(y/x) can't tell from the first.

atan2(-1,-1)
// → (-3/4)*pi
Open in Playground

On the positive y-axis.

atan2(1,0)
// → (1/2)*pi
Open in Playground

On the negative x-axis.

atan2(0,-1)
// → pi
Open in Playground

← Back to Function reference