]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/carg.3
crypt.3: srcfix: rewrap source lines
[thirdparty/man-pages.git] / man3 / carg.3
CommitLineData
fea681da 1.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2297bf0e 2.\"
38f20bb9 3.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
fea681da 4.\" Distributed under GPL
38f20bb9 5.\" %%%LICENSE_END
fea681da 6.\"
4b8c67d9 7.TH CARG 3 2017-09-15 "" "Linux Programmer's Manual"
fea681da 8.SH NAME
09a15e3d 9carg, cargf, cargl \- calculate the complex argument
fea681da
MK
10.SH SYNOPSIS
11.B #include <complex.h>
68e4db0a 12.PP
fea681da 13.BI "double carg(double complex " z ");"
d39541ec 14.br
fea681da 15.BI "float cargf(float complex " z ");"
d39541ec 16.br
fea681da 17.BI "long double cargl(long double complex " z ");"
68e4db0a 18.PP
20c58d70 19Link with \fI\-lm\fP.
fea681da 20.SH DESCRIPTION
8fd531f3
MK
21These functions calculate the complex argument (also called phase angle) of
22.IR z ,
23with a branch cut along the negative real axis.
847e0d88 24.PP
fea681da 25A complex number can be described by two real coordinates.
daac0b39 26One may use rectangular coordinates and gets
847e0d88 27.PP
daac0b39
MK
28.nf
29 z = x + I * y
30.fi
847e0d88 31.PP
c6fa0841
MK
32where
33.IR "x\ =\ creal(z)"
34and
35.IR "y\ =\ cimag(z)" .
dd3568a1 36.PP
daac0b39 37Or one may use polar coordinates and gets
207050fa 38.PP
daac0b39 39.nf
daac0b39 40 z = r * cexp(I * a)
daac0b39 41.fi
207050fa 42.PP
c6fa0841
MK
43where
44.IR "r\ =\ cabs(z)"
45is the "radius", the "modulus", the absolute value of
46.IR z ,
47and
48.IR "a\ =\ carg(z)"
49is the "phase angle", the argument of
50.IR z .
dd3568a1 51.PP
daac0b39 52One has:
207050fa 53.PP
daac0b39 54.nf
daac0b39
MK
55 tan(carg(z)) = cimag(z) / creal(z)
56.fi
47297adb 57.SH RETURN VALUE
8c383102 58The return value is the range of [\-pi,pi].
f0d7ce1d
MK
59.SH VERSIONS
60These functions first appeared in glibc in version 2.1.
4906e3f0
MS
61.SH ATTRIBUTES
62For an explanation of the terms used in this section, see
63.BR attributes (7).
64.TS
65allbox;
66lbw24 lb lb
67l l l.
68Interface Attribute Value
69T{
70.BR carg (),
71.BR cargf (),
72.BR cargl ()
73T} Thread safety MT-Safe
74.TE
47297adb 75.SH CONFORMING TO
9a74e018 76C99, POSIX.1-2001, POSIX.1-2008.
47297adb 77.SH SEE ALSO
fea681da 78.BR cabs (3),
a8bda636 79.BR complex (7)