1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
7 .TH CARG 3 2021-03-22 "" "Linux Programmer's Manual"
9 carg, cargf, cargl \- calculate the complex argument
12 .B #include <complex.h>
14 .BI "double carg(double complex " z ");"
15 .BI "float cargf(float complex " z ");"
16 .BI "long double cargl(long double complex " z ");"
21 These functions calculate the complex argument (also called phase angle) of
23 with a branch cut along the negative real axis.
25 A complex number can be described by two real coordinates.
26 One may use rectangular coordinates and gets
35 .IR "y\ =\ cimag(z)" .
37 Or one may use polar coordinates and gets
45 is the "radius", the "modulus", the absolute value of
49 is the "phase angle", the argument of
55 tan(carg(z)) = cimag(z) / creal(z)
58 The return value is in the range of [\-pi,pi].
60 These functions first appeared in glibc in version 2.1.
62 For an explanation of the terms used in this section, see
70 Interface Attribute Value
75 T} Thread safety MT-Safe
81 C99, POSIX.1-2001, POSIX.1-2008.