asp.net.ph

Math.Atan2 Method

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;

Parameters

y
The y coordinate of a point.
x
The x coordinate of a point.

Return Value

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.

Remarks

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 ) .

See Also

Math Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph