Previous  Next

MathArctan2

Return the angle (in radians) whose tangent is the quotient of two specified numbers.

double MathArctan2(
 double y     // The y coordinate of a point
 double x     // The x coordinate of a point
  );

Parameters

y

[in]  Y coordinate value.

x

[in]  X coordinate value.

Return Value

MathArctan2 returns an angle, θ, within the range from -π to π radians, so that MathTan(θ)=y/x.

Please note as follows:

For points on the boundaries of the quadrants, the return value is the following:

Note

Instead of the MathArctan2() function, you can use the atan2() function.