|
Packit |
7cfc04 |
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
|
|
Packit |
7cfc04 |
.\" Distributed under GPL
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_END
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.TH CARG 3 2017-09-15 "" "Linux Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
carg, cargf, cargl \- calculate the complex argument
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.B #include <complex.h>
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.BI "double carg(double complex " z ");"
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
.BI "float cargf(float complex " z ");"
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
.BI "long double cargl(long double complex " z ");"
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
Link with \fI\-lm\fP.
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
These functions calculate the complex argument (also called phase angle) of
|
|
Packit |
7cfc04 |
.IR z ,
|
|
Packit |
7cfc04 |
with a branch cut along the negative real axis.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
A complex number can be described by two real coordinates.
|
|
Packit |
7cfc04 |
One may use rectangular coordinates and gets
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
z = x + I * y
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
where
|
|
Packit |
7cfc04 |
.IR "x\ =\ creal(z)"
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.IR "y\ =\ cimag(z)" .
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
Or one may use polar coordinates and gets
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
z = r * cexp(I * a)
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
where
|
|
Packit |
7cfc04 |
.IR "r\ =\ cabs(z)"
|
|
Packit |
7cfc04 |
is the "radius", the "modulus", the absolute value of
|
|
Packit |
7cfc04 |
.IR z ,
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.IR "a\ =\ carg(z)"
|
|
Packit |
7cfc04 |
is the "phase angle", the argument of
|
|
Packit |
7cfc04 |
.IR z .
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
One has:
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
tan(carg(z)) = cimag(z) / creal(z)
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.SH RETURN VALUE
|
|
Packit |
7cfc04 |
The return value is the range of [\-pi,pi].
|
|
Packit |
7cfc04 |
.SH VERSIONS
|
|
Packit |
7cfc04 |
These functions first appeared in glibc in version 2.1.
|
|
Packit |
7cfc04 |
.SH ATTRIBUTES
|
|
Packit |
7cfc04 |
For an explanation of the terms used in this section, see
|
|
Packit |
7cfc04 |
.BR attributes (7).
|
|
Packit |
7cfc04 |
.TS
|
|
Packit |
7cfc04 |
allbox;
|
|
Packit |
7cfc04 |
lbw24 lb lb
|
|
Packit |
7cfc04 |
l l l.
|
|
Packit |
7cfc04 |
Interface Attribute Value
|
|
Packit |
7cfc04 |
T{
|
|
Packit |
7cfc04 |
.BR carg (),
|
|
Packit |
7cfc04 |
.BR cargf (),
|
|
Packit |
7cfc04 |
.BR cargl ()
|
|
Packit |
7cfc04 |
T} Thread safety MT-Safe
|
|
Packit |
7cfc04 |
.TE
|
|
Packit |
7cfc04 |
.SH CONFORMING TO
|
|
Packit |
7cfc04 |
C99, POSIX.1-2001, POSIX.1-2008.
|
|
Packit |
7cfc04 |
.SH SEE ALSO
|
|
Packit |
7cfc04 |
.BR cabs (3),
|
|
Packit |
7cfc04 |
.BR complex (7)
|
|
Packit |
7cfc04 |
.SH COLOPHON
|
|
Packit |
7cfc04 |
This page is part of release 4.15 of the Linux
|
|
Packit |
7cfc04 |
.I man-pages
|
|
Packit |
7cfc04 |
project.
|
|
Packit |
7cfc04 |
A description of the project,
|
|
Packit |
7cfc04 |
information about reporting bugs,
|
|
Packit |
7cfc04 |
and the latest version of this page,
|
|
Packit |
7cfc04 |
can be found at
|
|
Packit |
7cfc04 |
\%https://www.kernel.org/doc/man\-pages/.
|