]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/carg.3
man2/, man3/, man-pages.7: Move VERSIONS next to STANDARDS
[thirdparty/man-pages.git] / man3 / carg.3
1 '\" t
2 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .TH carg 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 carg, cargf, cargl \- calculate the complex argument
9 .SH LIBRARY
10 Math library
11 .RI ( libm ", " \-lm )
12 .SH SYNOPSIS
13 .nf
14 .B #include <complex.h>
15 .PP
16 .BI "double carg(double complex " z ");"
17 .BI "float cargf(float complex " z ");"
18 .BI "long double cargl(long double complex " z ");"
19 .fi
20 .SH DESCRIPTION
21 These functions calculate the complex argument (also called phase angle) of
22 .IR z ,
23 with a branch cut along the negative real axis.
24 .PP
25 A complex number can be described by two real coordinates.
26 One may use rectangular coordinates and gets
27 .PP
28 .in +4n
29 .EX
30 z = x + I * y
31 .EE
32 .in
33 .PP
34 where
35 .I x\~=\~creal(z)
36 and
37 .IR y\~=\~cimag(z) .
38 .PP
39 Or one may use polar coordinates and gets
40 .PP
41 .in +4n
42 .EX
43 z = r * cexp(I * a)
44 .EE
45 .in
46 .PP
47 where
48 .I r\~=\~cabs(z)
49 is the "radius", the "modulus", the absolute value of
50 .IR z ,
51 and
52 .I a\~=\~carg(z)
53 is the "phase angle", the argument of
54 .IR z .
55 .PP
56 One has:
57 .PP
58 .in +4n
59 .EX
60 tan(carg(z)) = cimag(z) / creal(z)
61 .EE
62 .in
63 .SH RETURN VALUE
64 The return value is in the range of [\-pi,pi].
65 .SH ATTRIBUTES
66 For an explanation of the terms used in this section, see
67 .BR attributes (7).
68 .ad l
69 .nh
70 .TS
71 allbox;
72 lbx lb lb
73 l l l.
74 Interface Attribute Value
75 T{
76 .BR carg (),
77 .BR cargf (),
78 .BR cargl ()
79 T} Thread safety MT-Safe
80 .TE
81 .hy
82 .ad
83 .sp 1
84 .SH VERSIONS
85 These functions were added in glibc 2.1.
86 .SH STANDARDS
87 C99, POSIX.1-2001, POSIX.1-2008.
88 .SH SEE ALSO
89 .BR cabs (3),
90 .BR complex (7)