Classes | Functions

/Users/garethloy/Musimathics/Musimat1.2/include/Complex.h File Reference

The Complex datatype. More...

#include <iostream>
#include <math.h>
#include "Musimat.h"

Go to the source code of this file.

Classes

class  Complex
 Complex class implements a set of data types, conversions, and operations for complex numbers. More...

Functions

Real RealPart (Complex c)
 Convenience function to get the real part of a Complex number.
Real ImagPart (Complex c)
 Convenience function to get the imaginary part of a Complex number.
Void RealPart (Complex &c, Real r)
 Convenience function to set the real part of a Complex number.
Void ImagPart (Complex &c, Real r)
 Convenience function to set the imaginary part of a Complex number.
Complex Abs (Complex c)
 Convenience function to return the absolute value of a Complex number.
Complex Conjugate (Complex c)
 Convenience function to return the conjugate value of a Complex number.
Complex Exp (Complex a, Complex b)
 Raise Complex a to the power of Complex b.
Complex Exp (Real r, Real theta)
 Raise Real r to the power of Real theta.

Detailed Description

The Complex datatype.

Definition in file Complex.h.


Function Documentation

Complex Abs ( Complex  c ) [inline]

Convenience function to return the absolute value of a Complex number.

Definition at line 263 of file Complex.h.

References Complex::Abs(), and Return.

Referenced by RealToRational().

{ Return(c.Abs()); }
Complex Conjugate ( Complex  c ) [inline]

Convenience function to return the conjugate value of a Complex number.

Definition at line 266 of file Complex.h.

References Return.

{ Return(~c); }
Complex Exp ( Real  r,
Real  theta 
) [inline]

Raise Real r to the power of Real theta.

Parameters:
rReal base
thetaReal exponent

Definition at line 279 of file Complex.h.

References Cos(), Return, and Sin().

                                       {
        Complex t(r * Cos(theta), r * Sin(theta));
        Return t;
}
Complex Exp ( Complex  a,
Complex  b 
) [inline]

Raise Complex a to the power of Complex b.

Parameters:
aComplex base
bComplex exponent

Definition at line 271 of file Complex.h.

References Complex::Exp(), and Return.

                                           {
        Complex x = a.Exp( b );
        Return x;
}
Void ImagPart ( Complex c,
Real  r 
) [inline]

Convenience function to set the imaginary part of a Complex number.

Definition at line 260 of file Complex.h.

References Complex::i().

{ c.i(r); }
Real ImagPart ( Complex  c ) [inline]

Convenience function to get the imaginary part of a Complex number.

Returns:
Imaginary part of Complex number as a Real

Definition at line 254 of file Complex.h.

References Complex::i(), and Return.

{ Return c.i(); }
Void RealPart ( Complex c,
Real  r 
) [inline]

Convenience function to set the real part of a Complex number.

Definition at line 257 of file Complex.h.

References Complex::r().

{ c.r(r); }
Real RealPart ( Complex  c ) [inline]

Convenience function to get the real part of a Complex number.

Returns:
Real part of Complex number as a Real

Definition at line 250 of file Complex.h.

References Complex::r(), and Return.

{ Return c.r(); }