9.3.18 ATAN2 (Y, X)

Description:  Produces an arctangent (with the result in radians). The result is the principal value of the argument of the nonzero complex number (X, Y). 
Class:  Elemental function 
Arguments:[1]  Y Must be of type real. 
  X Must have the same type and kind parameters as Y. 
Results:  The result type is the same as X. The value lies in the range -pi to pi. If X /= zero, the result is approximately equal to the value of arctan (Y /X).

If Y > zero, the result is positive.

If Y < zero, the result is negative.

If Y = zero, the result is zero (if X > zero) or pi (if X < zero).

If X = zero, the absolute value of the result is pi/2. 

[1] Both arguments must not have the value zero.

Specific Name  Argument Type  Result Type 
ATAN2  REAL(4)  REAL(4) 
DATAN2  REAL(8)  REAL(8) 
QATAN2  REAL(16)  REAL(16) 

Examples

ATAN2 (2.679676, 1.0) has the value 1.213623.

If Y has the value

  [  1   1 ]
  [ -1  -1 ]
and X has the value
  [ -1  1 ]
  [ -1  1 ],
then ATAN2 (Y, X) is


Previous Page Next Page Table of Contents