16 const double PI = 3.141592653589793238462643383279502884197169399375105820974944592308;
34 double mag()
const {
return sqrt(
a*
a+
b*
b); }
39 double theta = acos(
a/r );
41 if( sin(theta)-
b/r < 10e-6 )
47 void euler(
double& r,
double& theta )
140 os <<
"(" << p.
a <<
", " << p.
b <<
")";
const Complex & operator=(const Complex &p)
friend const Complex operator*(const double k, const Complex &p)
friend std::ostream & operator<<(std::ostream &os, const Complex &p)
friend const Complex operator-(const Complex &p, const Complex &q)
const Complex & operator+=(const Complex &p)
friend const Complex operator/(const Complex &p, const Complex &q)
const Complex & operator-=(const Complex &p)
void euler(double &r, double &theta)
Complex(double ta, double tb)
Complex(const Complex &p)
const Complex & operator/=(const double k)
class for the complex number and its arithmetic.
friend const Complex operator+(const Complex &p, const Complex &q)
const Complex & operator*=(const double k)