OSDN Git Service

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