atan2(y, x) computes the arctangent of the complex number .
FORTRAN 77 and later
result = atan2(y, x)
y- The type shall be
x- The type and kind type parameter shall be the same as
yis zero, then
xmust be nonzero.
The return value has the same type and kind type parameter as
y. It is the principal value of the complex number . If
x is nonzero, then it lies in the range . The sign is positive if
y is positive. If
y is zero, then the return value is zero if
x is positive and if
x is negative. Finally, if
x is zero, then the magnitude of the result is .
program test_atan2 real(4) :: x = 1.e0_4, y = 0.5e0_4 x = atan2(y,x) end program test_atan2