carg
calculate the argument
You're viewing an older version of this page (#3344). View the current version.
NAME
carg, cargf, cargl
INTERFACE
#include <complex.h>
double carg(double complex z ); float cargf(float complex z ); long double cargl(long double complex z );
DESCRIPTION
A complex number can be described by two real coordinates, either:
- using rectangular coordinates, such that z = x+i*y, where x = creal(z) and y = cimag(z).
- or using polar coordinates with z = r*cexp(i*a) where <cc>r = cabs(z)</cc> is the radius (also called the modulus or absolute value of z) and <cc>a = carg(z)</cc> is the phase angle (or argument of z).
The tan(carg(z)) = cimag(z) / creal(z).
RETURN VALUE
The return value is the range of [-pi, pi].
CONFORMING TO
C99
SEE ALSO
cabs (3)
Compatibility
<table class="compat"> <tr><th></th><th>DOS</th><th>UNIX</th><th>Windows</th><th>ANSI C</th><th>C++ only</th></tr> <tr><td>carg</td><td></td><td>•</td><td>•</td><td></td><td>•</td></tr> </table>