15 #ifndef _COMPLEX_H_MIDI
16 #define _COMPLEX_H_MIDI
38 extern struct Complex Czero;
43 #define MAKEC(real, imag, result) {result.r = real; result.i = imag;}
44 #define SETTOCONJ(dest, source) {dest.r = source.r; dest.i = -source.i;}
49 struct Complex Addc(struct Complex, struct Complex);
50 struct Complex Subtractc(struct Complex, struct Complex);
51 struct Complex Multiplyc(struct Complex z1, struct Complex z2);
52 struct Complex Dividec(struct Complex z1, struct Complex z2);
55 void AddCptr(
struct Complex *result,
struct Complex *z1,
struct Complex *z2);
56 void SubtractCptr(
struct Complex *result,
struct Complex *z1,
struct Complex *z2);
57 void MultiplyCptr(
struct Complex *result,
struct Complex *z1,
struct Complex *z2);
58 void MultiplyConjPtr(
struct Complex *result,
struct Complex *z1,
struct Complex *z2);
60 struct Complex Scalec(struct Complex z, float scale);
61 struct Complex Unitc(struct Complex z);
62 float Cmag(
struct Complex);
63 float Cmag2(
struct Complex);
64 void GetEtoJtimes(
float,
struct Complex *);
65 void GetScaledEtoJtimes(
float Angle,
struct Complex *Result,
float scale);
66 void RotateBy(
float,
struct Complex *);
70 struct Complex Csqrt(struct Complex);
71 void GetExpc(
struct Complex *Result,
struct Complex z);
72 struct Complex jtimes(struct Complex z);
75 void printC(
struct Complex z);
76 float Arg(
struct Complex z);