- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# C:/Musimathics_local/Musimat/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.

## Namespaces
namespace | std
## 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 264 of file Complex.h.

References Complex::Abs(), and Return.

Referenced by RealToRational().

    00264 { Return(c.Abs()); }

Complex Conjugate | ( | Complex | c | ) | `[inline]`

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

Definition at line 267 of file Complex.h.

References Return.

    00267 { Return(~c); }

Complex Exp | ( | Real | r,
|  | Real | theta |
| ) |  |  | `[inline]`

Raise Real r to the power of Real theta.

Parameters:

  | r | Real base
  | theta | Real exponent

Definition at line 280 of file Complex.h.

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

    00280                                        {
    00281         Complex t(r * Cos(theta), r * Sin(theta));
    00282         Return t;
    00283 }

Complex Exp | ( | Complex | a,
|  | Complex | b |
| ) |  |  | `[inline]`

Raise Complex a to the power of Complex b.

Parameters:

  | a | Complex base
  | b | Complex exponent

Definition at line 272 of file Complex.h.

References Complex::Exp(), and Return.

    00272                                            {
    00273         Complex x = a.Exp( b );
    00274         Return x;
    00275 }

Void ImagPart | ( | Complex & | c,
|  | Real | r |
| ) |  |  | `[inline]`

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

Definition at line 261 of file Complex.h.

References Complex::i().

    00261 { 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 255 of file Complex.h.

References Complex::i(), and Return.

    00255 { Return c.i(); }

Void RealPart | ( | Complex & | c,
|  | Real | r |
| ) |  |  | `[inline]`

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

Definition at line 258 of file Complex.h.

References Complex::r().

    00258 { 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 251 of file Complex.h.

References Complex::r(), and Return.

    00251 { Return c.r(); }