]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 2 | .\" |
95fb8859 | 3 | .\" SPDX-License-Identifier: GPL-1.0-or-later |
fea681da | 4 | .\" |
45186a5d | 5 | .TH CARG 3 2021-03-22 "Linux man-pages (unreleased)" |
fea681da | 6 | .SH NAME |
09a15e3d | 7 | carg, cargf, cargl \- calculate the complex argument |
2af19291 AC |
8 | .SH LIBRARY |
9 | Math library | |
8fc3b2cf | 10 | .RI ( libm ", " \-lm ) |
fea681da | 11 | .SH SYNOPSIS |
c7db92b9 | 12 | .nf |
fea681da | 13 | .B #include <complex.h> |
68e4db0a | 14 | .PP |
fea681da | 15 | .BI "double carg(double complex " z ");" |
fea681da | 16 | .BI "float cargf(float complex " z ");" |
fea681da | 17 | .BI "long double cargl(long double complex " z ");" |
c7db92b9 | 18 | .fi |
fea681da | 19 | .SH DESCRIPTION |
8fd531f3 MK |
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. | |
847e0d88 | 23 | .PP |
fea681da | 24 | A complex number can be described by two real coordinates. |
daac0b39 | 25 | One may use rectangular coordinates and gets |
847e0d88 | 26 | .PP |
1ae6b2c7 AC |
27 | .in +4n |
28 | .EX | |
29 | z = x + I * y | |
30 | .EE | |
31 | .in | |
847e0d88 | 32 | .PP |
c6fa0841 | 33 | where |
1ae6b2c7 | 34 | .I x\~=\~creal(z) |
c6fa0841 | 35 | and |
1ae6b2c7 | 36 | .IR y\~=\~cimag(z) . |
dd3568a1 | 37 | .PP |
daac0b39 | 38 | Or one may use polar coordinates and gets |
207050fa | 39 | .PP |
1ae6b2c7 AC |
40 | .in +4n |
41 | .EX | |
42 | z = r * cexp(I * a) | |
43 | .EE | |
44 | .in | |
207050fa | 45 | .PP |
c6fa0841 | 46 | where |
1ae6b2c7 | 47 | .I r\~=\~cabs(z) |
c6fa0841 MK |
48 | is the "radius", the "modulus", the absolute value of |
49 | .IR z , | |
50 | and | |
1ae6b2c7 | 51 | .I a\~=\~carg(z) |
c6fa0841 MK |
52 | is the "phase angle", the argument of |
53 | .IR z . | |
dd3568a1 | 54 | .PP |
daac0b39 | 55 | One has: |
207050fa | 56 | .PP |
1ae6b2c7 AC |
57 | .in +4n |
58 | .EX | |
59 | tan(carg(z)) = cimag(z) / creal(z) | |
60 | .EE | |
61 | .in | |
47297adb | 62 | .SH RETURN VALUE |
cb4b97d9 | 63 | The return value is in the range of [\-pi,pi]. |
f0d7ce1d MK |
64 | .SH VERSIONS |
65 | These functions first appeared in glibc in version 2.1. | |
4906e3f0 MS |
66 | .SH ATTRIBUTES |
67 | For an explanation of the terms used in this section, see | |
68 | .BR attributes (7). | |
c466875e MK |
69 | .ad l |
70 | .nh | |
4906e3f0 MS |
71 | .TS |
72 | allbox; | |
c466875e | 73 | lbx lb lb |
4906e3f0 MS |
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 | |
c466875e MK |
82 | .hy |
83 | .ad | |
84 | .sp 1 | |
3113c7f3 | 85 | .SH STANDARDS |
9a74e018 | 86 | C99, POSIX.1-2001, POSIX.1-2008. |
47297adb | 87 | .SH SEE ALSO |
fea681da | 88 | .BR cabs (3), |
a8bda636 | 89 | .BR complex (7) |