Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- e^(ix) = cos(x) + i sin(x)
- struct complex
- {
- float real;
- float imag;
- };
- struct complex sum(struct complex t1, struct complex t2)
- {
- struct complex t;
- t.real = t1.real + t2.real;
- t.imag = t1.imag + t2.imag;
- return t;
- }
- struct complex product(struct complex t1, struct complex t2)
- {
- struct complex t;
- t.real = t1.real * t2.real - t1.imag * t2.imag;
- t.imag = t1.real * t2.imag + t1.imag * t2.real;
- return t;
- }
Add Comment
Please, Sign In to add comment