Debian Codegraph @

upstream/debian-trixie/man3/carg.3

raw
1 '\" t
2 .\" Copyright 2002 Walter Harms ([email protected])
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .TH carg 3 2024-05-02 "Linux man-pages 6.9.1"
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 .P
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 .P
25 A complex number can be described by two real coordinates.
26 One may use rectangular coordinates and gets
27 .P
28 .in +4n
29 .EX
30 z = x + I * y
31 .EE
32 .in
33 .P
34 where
35 .I x\~=\~creal(z)
36 and
37 .IR y\~=\~cimag(z) .
38 .P
39 Or one may use polar coordinates and gets
40 .P
41 .in +4n
42 .EX
43 z = r * cexp(I * a)
44 .EE
45 .in
46 .P
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 .P
56 One has:
57 .P
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 .TS
69 allbox;
70 lbx lb lb
71 l l l.
72 Interface Attribute Value
73 T{
74 .na
75 .nh
76 .BR carg (),
77 .BR cargf (),
78 .BR cargl ()
79 T} Thread safety MT-Safe
80 .TE
81 .SH STANDARDS
82 C11, POSIX.1-2008.
83 .SH HISTORY
84 glibc 2.1.
85 C99, POSIX.1-2001.
86 .SH SEE ALSO
87 .BR cabs (3),
88 .BR complex (7)