Java.Lang.Math.Atan2 Method
Returns the closest double approximation of the arc tangent of y/x within the range [-pi..pi].

Syntax

[Android.Runtime.Register("atan2", "(DD)D", "")]
public static double Atan2 (double x, double y)

Parameters

y
the numerator of the value whose atan has to be computed.
x
the denominator of the value whose atan has to be computed.

Returns

Documentation for this section has not yet been entered.

Remarks

Returns the closest double approximation of the arc tangent of y/x within the range [-pi..pi]. This is the angle of the polar representation of the rectangular coordinates (x,y). The returned result is within 2 ulps (units in the last place) of the real result.

Special cases:

  • atan2((anything), NaN ) = NaN;
  • atan2(NaN , (anything) ) = NaN;
  • atan2(+0.0, +(anything but NaN)) = +0.0
  • atan2(-0.0, +(anything but NaN)) = -0.0
  • atan2(+0.0, -(anything but NaN)) = +pi
  • atan2(-0.0, -(anything but NaN)) = -pi
  • atan2(+(anything but 0 and NaN), 0) = +pi/2
  • atan2(-(anything but 0 and NaN), 0) = -pi/2
  • atan2(+(anything but infinity and NaN), +infinity)=+0.0
  • atan2(-(anything but infinity and NaN), +infinity)=-0.0
  • atan2(+(anything but infinity and NaN), -infinity) = +pi
  • atan2(-(anything but infinity and NaN), -infinity) = -pi
  • atan2(+infinity, +infinity ) = +pi/4
  • atan2(-infinity, +infinity ) = -pi/4
  • atan2(+infinity, -infinity ) = +3pi/4
  • atan2(-infinity, -infinity ) = -3pi/4
  • atan2(+infinity, (anything but,0, NaN, and infinity))=+pi/2
  • atan2(-infinity, (anything but,0, NaN, and infinity))=-pi/2

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1