@c ---------------------------------------------------------------------- @node atan2, math @subheading Syntax @example #include double atan2(double y, double x); @end example @subheading Description This function computes the angle, in the range @code{[-Pi..Pi]} radians, whose tangent is @code{@var{y}/@var{x}}. In other words, it computes the angle, in radians, of the vector (@var{x},@var{y}) with respect to the @code{+x} axis, reckoning the counterclockwise direction as positive, and returning the value in the range @code{[-Pi, Pi]}. @subheading Return Value The arc tangent, in radians, of @code{@var{y}/@var{x}}. @code{Pi} is returned if @var{x} is negative and @var{y} is a negative zero, @code{-0.0}. @code{-Pi} is returned, if @var{x} is negative, and @var{y} is a positive zero, @code{+0.0}. If either @var{x} or @var{y} is infinite, @code{atan2} returns, respectively, @code{Pi} with the sign of @var{y} or zero, and @code{errno} is left unchanged. However, if @emph{both} arguments are infinite, the return value is @code{NaN} and @code{errno} is set to @code{EDOM}. A @code{NaN} is returned, and @code{errno} is set to @code{EDOM}, if either @var{x} and @var{y} are both zero, or if either one of the arguments is a @code{NaN}. @subheading Portability @portability ansi, posix