ATAN2 intrinsic function

Standard: F77 F90 F95 F2003 F2008 Example program


ATAN2 ( Y, X )

X : Real;
Y : Same type and kind as X, conformable with X; the NAG Fortran Compiler also permits Y to have a different kind (this is non-standard);

Result : Same type as X, with kind the same as the kind of X+Y.


The value of the result is an approximation to the arc tangent of Y/X, where Y is the sine and X is the cosine. The result is in radians, in the range −π≤ATAN2(Y,X)≤π.

Like many intrinsic functions, this is elemental; if either (or both) of X and Y is an array, the result will be an array with that shape, with the value being computed elementwise.


ATAN intrinsic function, ATANH intrinsic function, COS intrinsic function, SIN intrinsic function, TAN intrinsic function