Returns the angle whose tangent is the specified number.
- Parameters
-
y | The y coordinate of a point. |
x | The x coordinate of a point. |
- Returns
- An angle, A, measured in radians, such that -PI <= A <= PI, and tan(?) = y / x, where (x, y) is a point in the Cartesian plane.
Observe the following:
- For (x, y) in quadrant 1, 0 < A < PI/2.
- For (x, y) in quadrant 2, PI/2 < A <= PI.
- For (x, y) in quadrant 3, -PI < A < -PI/2.
- For (x, y) in quadrant 4, -PI/2 < A < 0.
- For points on the boundaries of the quadrants, the return value is the following:
- If x is 0 and y is not negative, A = 0.
- If x is 0 and y is negative, A = PI.
- If x is positive and y is 0, A = PI/2.
- If x is negative and y is 0, A = -PI/2.