user_namespaces.7: Add an example program
[man-pages.git] / man3 / carg.3
blob1cfe2198c144a97bb894825f6a2ee6032f1c4dca
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .TH CARG 3 2008-08-11 "" "Linux Programmer's Manual"
8 .SH NAME
9 carg, cargf, cargl \- calculate the complex argument
10 .SH SYNOPSIS
11 .B #include <complex.h>
12 .sp
13 .BI "double carg(double complex " z ");"
14 .br
15 .BI "float cargf(float complex " z ");"
16 .br
17 .BI "long double cargl(long double complex " z ");"
18 .sp
19 Link with \fI\-lm\fP.
20 .SH DESCRIPTION
21 A complex number can be described by two real coordinates.
22 One may use rectangular coordinates and gets
24 .nf
25     z = x + I * y
26 .fi
28 where
29 .IR "x\ =\ creal(z)"
30 and
31 .IR "y\ =\ cimag(z)" .
32 .LP
33 Or one may use polar coordinates and gets
34 .nf
36     z = r * cexp(I * a)
38 .fi
39 where
40 .IR "r\ =\ cabs(z)"
41 is the "radius", the "modulus", the absolute value of
42 .IR z ,
43 and
44 .IR "a\ =\ carg(z)"
45 is the "phase angle", the argument of
46 .IR z .
47 .LP
48 One has:
49 .nf
51     tan(carg(z)) = cimag(z) / creal(z)
52 .fi
53 .SH RETURN VALUE
54 The return value is the range of [\-pi,pi].
55 .SH VERSIONS
56 These functions first appeared in glibc in version 2.1.
57 .SH CONFORMING TO
58 C99.
59 .SH SEE ALSO
60 .BR cabs (3),
61 .BR complex (7)