atan2
Four-quadrant arctangent.
Syntax
Section titled “Syntax”C = atan2(Y, X)Description
Section titled “Description”Returns the angle from the positive x-axis to the point (X, Y), in radians, in the range (-π, π]. Resolves the quadrant ambiguity that atan(Y/X) cannot.
Examples
Section titled “Examples”atan2(1, 1) % π/4atan2(1, -1) % 3π/4 (resolved correctly to upper-left)