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