]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/carg.3
540094f7e04c9ad8f3eee242552efe6a7e83f2b8
[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 2021-03-22 "" "Linux Programmer's Manual"
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 .nf
28 z = x + I * y
29 .fi
30 .PP
31 where
32 .IR "x\ =\ creal(z)"
33 and
34 .IR "y\ =\ cimag(z)" .
35 .PP
36 Or one may use polar coordinates and gets
37 .PP
38 .nf
39 z = r * cexp(I * a)
40 .fi
41 .PP
42 where
43 .IR "r\ =\ cabs(z)"
44 is the "radius", the "modulus", the absolute value of
45 .IR z ,
46 and
47 .IR "a\ =\ carg(z)"
48 is the "phase angle", the argument of
49 .IR z .
50 .PP
51 One has:
52 .PP
53 .nf
54 tan(carg(z)) = cimag(z) / creal(z)
55 .fi
56 .SH RETURN VALUE
57 The return value is in the range of [\-pi,pi].
58 .SH VERSIONS
59 These functions first appeared in glibc in version 2.1.
60 .SH ATTRIBUTES
61 For an explanation of the terms used in this section, see
62 .BR attributes (7).
63 .ad l
64 .nh
65 .TS
66 allbox;
67 lbx lb lb
68 l l l.
69 Interface Attribute Value
70 T{
71 .BR carg (),
72 .BR cargf (),
73 .BR cargl ()
74 T} Thread safety MT-Safe
75 .TE
76 .hy
77 .ad
78 .sp 1
79 .SH CONFORMING TO
80 C99, POSIX.1-2001, POSIX.1-2008.
81 .SH SEE ALSO
82 .BR cabs (3),
83 .BR complex (7)