1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
4 .TH CARG 3 2008-08-11 "" "Linux Programmer's Manual"
6 carg, cargf, cargl \- calculate the argument
8 .B #include <complex.h>
10 .BI "double carg(double complex " z ");"
12 .BI "float cargf(float complex " z ");"
14 .BI "long double cargl(long double complex " z ");"
18 A complex number can be described by two real coordinates.
19 One may use rectangular coordinates and gets
25 where \fIx\ =\ creal(z)\fP and \fIy\ =\ cimag(z)\fP.
27 Or one may use polar coordinates and gets
33 where \fIr\ =\ cabs(z)\fP
34 is the "radius", the "modulus", the absolute value of \fIz\fP, and
36 is the "phase angle", the argument of \fIz\fP.
41 tan(carg(z)) = cimag(z) / creal(z)
44 The return value is the range of [\-pi,pi].
46 These functions first appeared in glibc in version 2.1.