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 2008-08-11 "" "Linux Programmer's Manual"
9 carg, cargf, cargl \- calculate the complex argument
11 .B #include <complex.h>
13 .BI "double carg(double complex " z ");"
15 .BI "float cargf(float complex " z ");"
17 .BI "long double cargl(long double complex " z ");"
21 A complex number can be described by two real coordinates.
22 One may use rectangular coordinates and gets
28 where \fIx\ =\ creal(z)\fP and \fIy\ =\ cimag(z)\fP.
30 Or one may use polar coordinates and gets
36 where \fIr\ =\ cabs(z)\fP
37 is the "radius", the "modulus", the absolute value of \fIz\fP, and
39 is the "phase angle", the argument of \fIz\fP.
44 tan(carg(z)) = cimag(z) / creal(z)
47 The return value is the range of [\-pi,pi].
49 These functions first appeared in glibc in version 2.1.