29 #ifndef __MATH_COMPLEX_H__
30 #define __MATH_COMPLEX_H__
48 void Set(
const float r,
const float i );
89 float Abs(
void )
const;
95 const char *
ToString(
int precision = 2 )
const;
99 #define complex_zero complex_origin
119 assert( index >= 0 && index < 2 );
124 assert( index >= 0 && index < 2 );
146 t = 1.0f / ( a.
r + s * a.
i );
147 return idComplex( (
r + s *
i ) * t, ( i - s *
r ) * t );
150 t = 1.0f / ( s * a.
r + a.
i );
172 t = 1.0f / ( a.
r + s * a.
i );
173 *
this =
idComplex( (
r + s *
i ) * t, ( i - s *
r ) * t );
176 t = 1.0f / ( s * a.
r + a.
i );
242 t = a / ( b.
r + s * b.
i );
246 t = a / ( s * b.
r + b.
i );
263 t = 1.0f / (
r + s *
i );
267 t = 1.0f / ( s *
r +
i );
275 if (
r == 0.0
f &&
i == 0.0
f ) {
293 return idComplex( 0.5
f * y / w, (
i >= 0.0
f ) ? w : -w );
303 }
else if ( y == 0.0
f ) {
305 }
else if ( x > y ) {
315 return ( (
r == a.
r ) && (
i == a.
i ) );
idComplex & operator*=(const idComplex &a)
assert(prefInfo.fullscreenBtn)
idComplex Reciprocal(void) const
idComplex & operator+=(const idComplex &a)
ID_INLINE idComplex operator+(const float a, const idComplex &b)
static float Sqrt(float x)
bool operator==(const idComplex &a) const
ID_INLINE idComplex operator/(const float a, const idComplex &b)
idComplex Sqrt(void) const
idComplex & operator-=(const idComplex &a)
idComplex operator+(const idComplex &a) const
GLubyte GLubyte GLubyte GLubyte w
static float Fabs(float f)
idComplex operator/(const idComplex &a) const
int GetDimension(void) const
idComplex operator*(const idComplex &a) const
GLubyte GLubyte GLubyte a
bool Compare(const idComplex &a) const
float operator[](int index) const
ID_INLINE idComplex operator*(const float a, const idComplex &b)
idComplex operator-() const
GLdouble GLdouble GLdouble r
bool operator!=(const idComplex &a) const
void Set(const float r, const float i)
ID_INLINE idComplex operator-(const float a, const idComplex &b)
idComplex & operator/=(const idComplex &a)
const float * ToFloatPtr(void) const
idComplex & operator=(const idComplex &a)
const char * ToString(int precision=2) const