MA-1
This commit is contained in:
BIN
Binary file not shown.
@@ -78,9 +78,11 @@ Complex mulComplex(Complex y, Complex x) {
|
|||||||
\*--------------------------------------------------------------------*/
|
\*--------------------------------------------------------------------*/
|
||||||
Complex divComplex(Complex x, Complex y)
|
Complex divComplex(Complex x, Complex y)
|
||||||
{
|
{
|
||||||
Complex quotient;
|
Complex quotient = {};
|
||||||
|
|
||||||
if(y.real != 0 && y.imag != 0 )
|
if(y.real != 0 && y.imag != 0 )
|
||||||
{
|
{
|
||||||
|
|
||||||
quotient.real = (x.real * y.real + x.imag * y.imag) / (y.real * y.real + y.imag * y.imag);
|
quotient.real = (x.real * y.real + x.imag * y.imag) / (y.real * y.real + y.imag * y.imag);
|
||||||
quotient.imag = (x.imag * y.real - x.real * y.imag) / (y.real * y.real + y.imag * y.imag);
|
quotient.imag = (x.imag * y.real - x.real * y.imag) / (y.real * y.real + y.imag * y.imag);
|
||||||
|
|
||||||
@@ -89,6 +91,8 @@ Complex divComplex(Complex x, Complex y)
|
|||||||
|
|
||||||
return quotient;
|
return quotient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return quotient;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*\
|
/*--------------------------------------------------------------------*\
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user