Пример #1
0
/*******************************************************************************************
	* operator
********************************************************************************************/
Complex		operator * ( Complex a, Complex b )
{
	const double	real		=		a.real() * b.real() - a.image() * b.image();
	const double	image	=		a.real() * b.image() + a.image() * b.real();
	
	Complex		c( real, image );
	
	return	c;
}
Пример #2
0
/*******************************************************************************************
	/ operator 
********************************************************************************************/
Complex		operator / ( Complex a, Complex b )
{
	const double	den		=		b.real()*b.real() + b.image()*b.image();
	
	ErrorExceptionMacro( den != 0 );		// iff b is zero.
	
	const double	real		=		a.real() * b.real() + a.image() * b.image();
	const double	image	=		a.image() * b.real() - a.real() * b.image();
	
	Complex		c( real/den , image/den );
	
	return	c;
}