atan

From OpenGL Reference
Jump to navigation Jump to search

Return the arc-tangent of the parameters.

Declaration[edit]

genType atan( genType y, genType x );
genType atan( genType y_over_x );


Parameters[edit]

y - Specify the numerator of the fraction whose arctangent to return.
x - Specify the denominator of the fraction whose arctangent to return.
y_over_x - Specify the fraction whose arctangent to return.


Description[edit]

 atan returns either the angle whose trigonometric arctangent is [math]y \over x[/math] or y_over_x , depending on which overload is invoked. In the first overload, the signs of [math]y[/math] and [math]x[/math] are used to determine the quadrant that the angle lies in. The value returned by atan in this case is in the range [math][-\pi,\pi][/math]. The result is undefined if [math]x = 0[/math].

For the second overload, atan returns the angle whose tangent is y_over_x . The value returned in this case is in the range [math][-{\pi \over 2 },{\pi \over 2}][/math].

Version Support[edit]

atan 1.1+

See Also[edit]

 sin , cos , tan 


Copyright[edit]

Copyright© 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.