1CARG(3)                    Linux Programmer's Manual                   CARG(3)
2
3
4

NAME

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

SYNOPSIS

9       #include <complex.h>
10
11       double carg(double complex z);
12       float cargf(float complex z);
13       long double cargl(long double complex z);
14
15       Link with -lm.
16

DESCRIPTION

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

RETURN VALUE

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

VERSIONS

43       These functions first appeared in glibc in version 2.1.
44

ATTRIBUTES

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

CONFORMING TO

56       C99, POSIX.1-2001, POSIX.1-2008.
57

SEE ALSO

59       cabs(3), complex(7)
60

COLOPHON

62       This  page  is  part of release 5.12 of the Linux man-pages project.  A
63       description of the project, information about reporting bugs,  and  the
64       latest     version     of     this    page,    can    be    found    at
65       https://www.kernel.org/doc/man-pages/.
66
67
68
69                                  2021-03-22                           CARG(3)
Impressum