Format #include <math.h> double atan2 (double y, double x); float atan2f (float y, float x); (Integrity servers, Alpha) long double atan2l (long double y, long double x); (Integrity servers, Alpha) double atand2 (double y, double x); (Integrity servers, Alpha) float atand2f (float y, float x); (Integrity servers, Alpha) long double atand2l (long double y, long double x); (Integrity servers, Alpha)
1 – Arguments
y A radian expressed as a real number. x A radian expressed as a real number.
2 – Description
The atan2 functions compute the principal value of the arc tangent of y/x in the range [-pi,pi] radians. The sign of atan2 and atan2f is determined by the sign of y. The value of atan2(y,x) is computed as follows, where f is the number of fraction bits associated with the data type: Value of Input Arguments Angle Returned x = 0 or y/x > pi/2 * (sign y) 2**(f+1) x > 0 and y/x <= atan(y/x) 2**(f+1) x < 0 and y/x <= pi * (sign y) + atan(y/x) 2**(f+1) The atand2 functions compute the principal value of the arc tangent of y/x in the range [-180,180] degrees. The sign of atand2 and atand2f is determined by the sign of y. The following are invalid arguments for the atan2 and atand2 functions: Function Exceptional Argument atan2, atan2f, atan2l x = y = 0 atan2, atan2f, atan2l |x| = |y| = Infinity atand2, atand2f, atand2l x = y = 0 atand2, atand2f, atand2l |x| = |y| = Infinity