answersLogoWhite

0

typedef struct complex {

double real, imag;

} complex;

...

complex x, y, z;

...

/* add */

z.real = x.real + y.real;

z.imag = x.imag + y.imag;

/* sub */

z.real = x.real - y.real;

z.imag = x.imag - y.imag;

/* mul */

z.real = x.real*y.real - x.imag*y.imag;

z.imag =x.imag*y.real + x.real*y.imag;

/* div */

double d = y.real*y.real + y.imag*y.imag;

z.real = (x.real*y.real + x.imag*y.imag)/d;

z.imag = (x.imag*y.real - x.real*y.imag)/d;

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

The sum of a number plus 3 is squared is 11 more than the sum of the number plus 2 when squared What is the number?

When the sum of a number plus 3 is squared, it is 11 more than the sum of the number plus 2 when squared.


How do you calculate 4.18 plus j3.24?

To calculate the sum of the complex numbers (4.18) and (j3.24), you simply add the real parts and the imaginary parts separately. The result is (4.18 + j3.24). There are no like terms to combine, so the sum remains in its original form.


Is the sum of a complex number and its conjugate a real or imaginary number?

Their sum is real.


How do you calculate this sum 18-2x3 plus 1?

13


When the sum of a number plus 3 is squared it is 9 more than the sum of the number plus 2 when squared-?

The sum of a number plus 3 to the square root of 9 to the sum of 2 would equal -2. This is a math problem.


When the sum of a number plus 3 is squared it is 9 more than the sum of the number plus 2 when squared?

2


When the sum of a number plus 3 is squared it is 11 more than the sum of the number plus 2 when squared?

3


When the sum of a number plus 3 is squared it is 13 more than the sum of the number plus 2 when squared?

4


When the sum of a number plus 3 is squared it is thirteen more than the sum of the number plus 2 when squared?

4


When the sum of a number plus three is squared it is 13 more than the sum of the number plus two when squared.?

4


When the sum of a number plus 3 is squared it is 9 more than the sum of the number plus 2 when squares?

2


When the sum of a number plus 3 is squared it is 9 more than the sum of the number plus 2 when squared.?

2