DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

cartpol(3C++)


cartpol -- cartesian/polar functions for the C++ Complex Math Library

Synopsis

   #include <complex.h>
   class complex {
   

public: friend double abs(complex) throw(); friend double arg(complex) throw(); friend complex conj(complex) throw(); friend double imag(complex) throw(); friend double norm(complex) throw(); friend complex polar(double, double = 0); friend double real(complex) throw();
};

Description

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 = abs(x)
Returns the absolute value or magnitude of x.

d = norm(x)
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 = arg(x)
Returns the angle of x, measured in radians in the range -GREEK SMALL LETTER PI to GREEK SMALL LETTER PI.

y = conj(x)
Returns the complex conjugate of x. That is, if x is (real, imag), then conj(x) is (real, -imag).

y = polar(m, a)
Creates a complex given a pair of polar coordinates, magnitude m, and angle a, measured in radians.

d = real(x)
Returns the real part of x.

d = imag(x)
Returns the imaginary part of x.

References

complex(3C++), complex_error(3C++), cplxops(3C++), cplxexp(3C++), cplxtrig(3C++).
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004