Hey, hab grade mal Lust bekommen, nen paar Fraktale zu proggen, und da fing ich mal mit ner Klasse complex number an

Und weil das sonnst nur auf eminrer Festplatte vergammelt, stell ich die mal hier rein
Code:
#include <iostream>
#include <math.h>
class complex
{
public:
double r;
double i;
complex(){i=0;r=0;}
complex(double R,double I){i=I;r=R;}
~complex(){}
complex operator+(complex other)
{
complex result;
result.r=other.r+r;
result.i=other.i+i;
return(result);
}
complex operator-(complex other)
{
complex result;
result.r=other.r-r;
result.i=other.i-i;
return(result);
}
complex operator*(complex other)
{
complex result;
result.r=r*other.r-i*other.i;
result.i=i*other.r+r*other.i;
return(result);
}
complex operator/(complex other)
{
complex result;
result.r=(r*other.r+i*other.i)/(other.r*other.r+other.i*other.i);
result.i=(i*other.r-r*other.i)/(other.r*other.r+other.i*other.i);
return(result);
}
complex operator+=(complex other)
{
r+=other.r;
i+=other.i;
return((*this));
}
complex operator-=(complex other)
{
r-=other.r;
i-=other.i;
return((*this));
}
complex operator*=(complex other)
{
complex result;
result.r=r*other.r-i*other.i;
result.i=i*other.r+r*other.i;
r=result.r;
i=result.i;
return(result);
}
complex operator/=(complex other)
{
complex result;
result.r=(r*other.r+i*other.i)/(other.r*other.r+other.i*other.i);
result.i=(i*other.r-r*other.i)/(other.r*other.r+other.i*other.i);
r=result.r;
i=result.i;
return(result);
}
complex operator=(complex other)
{
r=other.r;
i=other.i;
return((*this));
}
bool operator==(complex other)
{
return(i==other.i && r==other.r);
}
bool operator !=(complex other)
{
return(!(i==other.i && r==other.r));
}
double getLengthSQ()
{
return(r*r+i*i);
}
double getLength()
{
return(sqrt(r*r+i*i));
}
complex getPolar()
{
complex result;
result.r=getLength();
result.i=atan(i/r);
return(result);
}
void print()
{
std::cout<<r<<"+"<<i<<"i"<<std::endl;
}
};