calculate the argument

You're viewing an older version of this page (#3450). View the current version.

View versions (3)

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 + {\rm i} y, where x = creal(z) and y = cimag(z).
  • or using polar coordinates:
z = r {\rm e}^{{\rm i} a}
(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 [-\pi, \pi].

CONFORMING TO

C99

SEE ALSO

reference:cabs

Compatibility

DOSUNIXWindowsANSI CC++ only
carg•••