]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/carg.3
dlinfo.3: ATTRIBUTES: Note function that is thread-safe
[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.\"
c73595c2 7.TH CARG 3 2015-04-19 "" "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>
12.sp
13.BI "double carg(double complex " z ");"
d39541ec 14.br
fea681da 15.BI "float cargf(float complex " z ");"
d39541ec 16.br
fea681da
MK
17.BI "long double cargl(long double complex " z ");"
18.sp
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.
24
fea681da 25A complex number can be described by two real coordinates.
daac0b39
MK
26One may use rectangular coordinates and gets
27
28.nf
29 z = x + I * y
30.fi
31
c6fa0841
MK
32where
33.IR "x\ =\ creal(z)"
34and
35.IR "y\ =\ cimag(z)" .
fea681da 36.LP
daac0b39
MK
37Or one may use polar coordinates and gets
38.nf
39
40 z = r * cexp(I * a)
41
42.fi
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 .
fea681da 51.LP
daac0b39
MK
52One has:
53.nf
54
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)