[Contents] [Previous Section] [Next Section] [Index]


atan2-Arc Tangent of Angle with Two Arguments

Interface

F_TYPE atan2 (F_TYPE y, F_TYPE x)

F_TYPE atand2 (F_TYPE y, F_TYPE x)

Description

atan2() computes the angle in the interval [-pi,pi] whose arc tangent is y/x radians for x and y in the interval [-infinity, +infinity]. The sign of atan2() is the same as the sign of y. The atan2(y, x) function is computed as follows where f is the number of fraction bits associated with the data type:
Value of Input Arguments  	Angle Returned

                f+1   
x = 0 or y/x > 2      		pi/2 * (signy)

                         f+1
x > 0 and y/x is < or = 2       atan(y/x)
             
                         f+1
x < 0 and y/x is < or = 2       pi * (signy) + atan(y/x)




atand2() computes the angle in the interval [-180,180] whose arc tangent is y/x degrees for x and y in the interval [-infinity, +infinity]. The sign of atand2() is the same as the sign of y.

Exceptions


Exceptional Argument       		Routine Behavior

y = x = 0                  		Invalid argument

|y| = infinity and |x| = infinity  	Invalid argument



[Contents] [Previous Section] [Next Section] [Index]