//====================================================//
// //
// Overloaded * //
// //
//====================================================//
MYCOMPLEX MYCOMPLEX::operator*(const MYCOMPLEX& w)
{
MYCOMPLEX product;
product.real = real*w.real - imaginary*w.imaginary;
product.imaginary = real*w.imaginary + imaginary*w.real;
return product;
}
MYCOMPLEX operator*(const int& i,const MYCOMPLEX& w)
{
MYCOMPLEX product;
product.real = (double)i*w.real;
product.imaginary = (double)i*w.imaginary;
return product;
}
MYCOMPLEX operator*(const float& x,const MYCOMPLEX& w)
{
MYCOMPLEX product;
product.real = (double)x*w.real;
product.imaginary = (double)x*w.imaginary;
return product;
}
MYCOMPLEX operator*(const double& x,const MYCOMPLEX& w)
{
MYCOMPLEX product;
product.real = x*w.real;
product.imaginary = x*w.imaginary;
return product;
}
MYCOMPLEX operator*(const MYCOMPLEX& w,const int& i)
{
MYCOMPLEX product;
product.real = (double)i*w.real;
product.imaginary = (double)i*w.imaginary;
return product;
}
MYCOMPLEX operator*(const MYCOMPLEX& w,const float& x)
{
MYCOMPLEX product;
product.real = (double)x*w.real;
product.imaginary = (double)x*w.imaginary;
return product;
}
MYCOMPLEX operator*(const MYCOMPLEX& w,const double& x)
{
MYCOMPLEX product;
product.real = x*w.real;
product.imaginary = x*w.imaginary;
return product;
}