1carg(3)                    Library Functions Manual                    carg(3)
2
3
4

NAME

6       carg, cargf, cargl - calculate the complex argument
7

LIBRARY

9       Math library (libm, -lm)
10

SYNOPSIS

12       #include <complex.h>
13
14       double carg(double complex z);
15       float cargf(float complex z);
16       long double cargl(long double complex z);
17

DESCRIPTION

19       These  functions  calculate the complex argument (also called phase an‐
20       gle) of z, with a branch cut along the negative real axis.
21
22       A complex number can be described by two real coordinates.  One may use
23       rectangular coordinates and gets
24
25           z = x + I * y
26
27       where x = creal(z) and y = cimag(z).
28
29       Or one may use polar coordinates and gets
30
31           z = r * cexp(I * a)
32
33       where r = cabs(z) is the "radius", the "modulus", the absolute value of
34       z, and a = carg(z) is the "phase angle", the argument of z.
35
36       One has:
37
38           tan(carg(z)) = cimag(z) / creal(z)
39

RETURN VALUE

41       The return value is in the range of [-pi,pi].
42

ATTRIBUTES

44       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
45       tributes(7).
46
47       ┌────────────────────────────────────────────┬───────────────┬─────────┐
48Interface                                   Attribute     Value   
49       ├────────────────────────────────────────────┼───────────────┼─────────┤
50carg(), cargf(), cargl()                    │ Thread safety │ MT-Safe │
51       └────────────────────────────────────────────┴───────────────┴─────────┘
52

STANDARDS

54       C11, POSIX.1-2008.
55

HISTORY

57       glibc 2.1.  C99, POSIX.1-2001.
58

SEE ALSO

60       cabs(3), complex(7)
61
62
63
64Linux man-pages 6.04              2023-03-30                           carg(3)
Impressum