CARTPOL(3C++) CARTPOL(3C++)
polar - functions for the C++ Complex Math Library
#include <complex.h>
class complex {
public:
friend double abs(complex);
friend double arg(complex);
friend complex conj(complex);
friend double imag(complex);
friend double norm(complex);
friend complex polar(double, double = 0);
friend double real(complex);
};
The following functions are defined for complex, where:
- d, m, and a are of type integer and
- x and y are of type complex.
d <b>= abs(x<b>) Returns the absolute value or magnitude of x.
d <b>= norm(x<b>) Returns the square of the magnitude of x. It is faster
than abs, but more likely to cause an overflow error. It
is intended for comparison of magnitudes.
d <b>= arg(x<b>) Returns the angle of x, measured in radians in the range
-J to J.
y <b>= conj(x<b>) Returns the complex conjugate of x. That is, if x is
(real, imag), then conj(x<b>) is (real, -imag).
y <b>= polar(m<b>, a<b>)
Creates a complex given a pair of polar coordinates,
magnitude m, and angle a, measured in radians.
d <b>= real(x<b>) Returns the real part of x.
d <b>= imag(x<b>) Returns the imaginary part of x.
complex(3C++), cplxerr(3C++), cplxops(3C++), cplxexp(3C++), and
cplxtrig(3C++).
PPPPaaaaggggeeee 1111 [ Back ]
|