1CARG(3) Linux Programmer's Manual CARG(3)
2
3
4
6 carg, cargf, cargl - calculate the complex argument
7
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
18 These functions calculate the complex argument (also called phase
19 angle) 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
40 The return value is the range of [-pi,pi].
41
43 These functions first appeared in glibc in version 2.1.
44
46 For an explanation of the terms used in this section, see
47 attributes(7).
48
49 ┌─────────────────────────┬───────────────┬─────────┐
50 │Interface │ Attribute │ Value │
51 ├─────────────────────────┼───────────────┼─────────┤
52 │carg(), cargf(), cargl() │ Thread safety │ MT-Safe │
53 └─────────────────────────┴───────────────┴─────────┘
55 C99, POSIX.1-2001, POSIX.1-2008.
56
58 cabs(3), complex(7)
59
61 This page is part of release 5.04 of the Linux man-pages project. A
62 description of the project, information about reporting bugs, and the
63 latest version of this page, can be found at
64 https://www.kernel.org/doc/man-pages/.
65
66
67
68 2017-09-15 CARG(3)