System Namespace Math Class
Returns the angle whose tangent is the quotient of two specified numbers.
[ VB ]
Public Shared Function Atan2 ( _
ByVal y As Double, _
ByVal x As Double _
) As Double
[ C# ]
public static double Atan2 (
double y,
double x
);
[ C++ ]
public: static double Atan2 (
double y,
double x
);
[ JScript ]
public static function Atan2 (
y : double,
x : double
) : double;
- y
- The y coordinate of a point.
- x
- The x coordinate of a point.
An angle, q, measured in radians, such that -π < q ≤ π, and tan ( q ) = y/ x, where ( x, y ) is a point in the Cartesian plane. Observe the following:
- For ( x, y ) in quadrant 1, 0 < q < π/2.
- For ( x, y ) in quadrant 2, π/2 < q ≤ π.
- For ( x, y ) in quadrant 3, -π < q < -π/2.
- For ( x, y ) in quadrant 4, -π/2 < q < 0.
The return value is the angle in the Cartesian plane formed by the x-axis, and a vector starting from the origin, ( 0,0 ) , and terminating at the point, ( x,y ) .
Math Members