OSDN Git Service

(split) LDP: Update original to LDP v3.50.
[linuxjm/LDP_man-pages.git] / original / man3 / carg.3
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
23
24 .nf
25     z = x + I * y
26 .fi
27
28 where \fIx\ =\ creal(z)\fP and \fIy\ =\ cimag(z)\fP.
29 .LP
30 Or one may use polar coordinates and gets
31 .nf
32
33     z = r * cexp(I * a)
34
35 .fi
36 where \fIr\ =\ cabs(z)\fP
37 is the "radius", the "modulus", the absolute value of \fIz\fP, and
38 \fIa\ =\ carg(z)\fP
39 is the "phase angle", the argument of \fIz\fP.
40 .LP
41 One has:
42 .nf
43
44     tan(carg(z)) = cimag(z) / creal(z)
45 .fi
46 .SH RETURN VALUE
47 The return value is the range of [\-pi,pi].
48 .SH VERSIONS
49 These functions first appeared in glibc in version 2.1.
50 .SH CONFORMING TO
51 C99.
52 .SH SEE ALSO
53 .BR cabs (3),
54 .BR complex (7)