carg
calculate the argument
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
, where x = creal(z) and y = cimag(z).
- or using polar coordinates:
(1)
where r = cabs(z) is the radius (also called the modulus or absolute value of z) and a = carg(z) is the phase angle (or argument of z).
Therefore, this function returns the phase angle of the complex number z, when it is written using polar coordinates.
RETURN VALUE
The return value is the range of .
CONFORMING TO
C99
Compatibility
| DOS | UNIX | Windows | ANSI C | C++ only | |
|---|---|---|---|---|---|
| carg | • | • | • |