2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
12 .. index:: trigonometric function, tangent, inverse, degrees
14 .. index:: tangent, inverse, degrees
16 ATAN2D --- Arctangent function, degrees
17 ***************************************
19 .. function:: ATAN2D(Y, X)
21 ``ATAN2D(Y, X)`` computes the principal value of the argument
22 function of the complex number X + i Y in degrees. This function can
23 be used to transform from Cartesian into polar coordinates and
24 allows to determine the angle in the correct quadrant.
27 The type shall be ``REAL``.
30 The type and kind type parameter shall be the same as :samp:`{Y}`.
31 If :samp:`{Y}` is zero, then :samp:`{X}` must be nonzero.
34 The return value has the same type and kind type parameter as :samp:`{Y}`. It
35 is the principal value of the complex number X + i Y. If :samp:`{X}`
36 is nonzero, then it lies in the range -180 \le \atan (x) \leq 180.
37 The sign is positive if :samp:`{Y}` is positive. If :samp:`{Y}` is zero, then
38 the return value is zero if :samp:`{X}` is strictly positive, 180 if
39 :samp:`{X}` is negative and :samp:`{Y}` is positive zero (or the processor does
40 not handle signed zeros), and -180 if :samp:`{X}` is negative and
41 :samp:`{Y}` is negative zero. Finally, if :samp:`{X}` is zero, then the
42 magnitude of the result is 90.
45 GNU extension, enabled with :option:`-fdec-math`.
51 .. code-block:: fortran
56 .. code-block:: fortran
59 real(4) :: x = 1.e0_4, y = 0.5e0_4
61 end program test_atan2d