Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cartpol(3C++) — ProWorks Compilers 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cplx.intro(3C++)

cplxerr(3C++)

cplxexp(3C++)

cplxops(3C++)

cplxtrig(3C++)

CARTPOL(3C++)

NAME

cartpol − cartesian/polar functions in the C++ complex number math library

SYNOPSIS

#include <complex.h>
class complex {
public:
    friend double  abs(const complex);
    friend double  norm(const complex);
    friend double  arg(const complex);
    friend complex conj(const complex);
    friend double  imag(const complex&);
    friend double  real(const complex&);
    friend complex polar(double magnitude, double angle= 0.0);
... // remainder not shown here
};

DESCRIPTION

These functions enable conversions between the Cartesian coordinates of the implementation and polar coordinates which are needed for some applications. 

double mag = abs(x)
Returns the absolute value, or magnitude, of complex number x. 

double mag = norm(x)
Returns the square of the absolute value of complex number x.  This is faster than abs, since the square root is not calculated, and is useful for comparing magnitudes of complex numbers. 

double ang = arg(x)
Returns the angle, or argument, in radians from −π to +π, of the polar coordinate representation of complex number x. 

complex z = conj(x)
Returns the complex conjugate of complex number x.  If x has the value (r,i), the complex conjugate has the value (r,−i). 

double i = imag(x)
Returns the imaginary part of complex number x. 

double r = real(x)
Returns the real part of complex number x. 

complex x = polar(mag, ang)
Given a pair of polar coordinates mag (magnitude) and ang (angle or argument) in radians from −π to +π, returns a complex number with the same value. 

SEE ALSO

cplx.intro(3C++), cplxerr(3C++), cplxexp(3C++), cplxops(3C++), cplxtrig(3C++), Complex Tutorial . 
 

SunOS 3.0.1  —  Last change: 24 March 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026