The arc-tangent of two arguments
atan2(y, x) returns the angle
between the x-axis and the vector from the origin to \((x, y)\),
i.e., for positive arguments
atan2(y, x) == atan(y/x).
Angles are in radians, not degrees, for the standard versions (i.e., a
right angle is \(\pi/2\)), and in ‘half-rotations’ for
tanpi(x) are accurate
x values which are multiples of a half.
atan2 are internal generic primitive
functions: methods can be defined for them individually or via the
Math group generic.
These are all wrappers to system calls of the same name (with prefix
c for complex arguments) where available. (
tanpi are part of a C11 extension
and provided by e.g.macOS and Solaris: where not yet
available call to
cos etc are used, with special cases
for multiples of a half.)