The SUMO toolbox  2018a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
Complex Class Reference

Complex implements a complex number and defines complex arithmetic and mathematical functions. More...

Public Member Functions

 Complex (double u, double v)
 Constructs the complex number z = u + i*v. More...
 
double real ()
 Real part of this Complex number (the x-coordinate in rectangular coordinates). More...
 
double imag ()
 Imaginary part of this Complex number (the y-coordinate in rectangular coordinates). More...
 
double mod ()
 Modulus of this Complex number (the distance from the origin in polar coordinates). More...
 
double arg ()
 Argument of this Complex number (the angle in radians with the x-axis in polar coordinates). More...
 
Complex conj ()
 Complex conjugate of this Complex number (the conjugate of x+i*y is x-i*y). More...
 
Complex plus (Complex w)
 Addition of Complex numbers (doesn't change this Complex number). More...
 
Complex minus (Complex w)
 Subtraction of Complex numbers (doesn't change this Complex number). More...
 
Complex times (Complex w)
 Complex multiplication (doesn't change this Complex number). More...
 
Complex div (Complex w)
 Division of Complex numbers (doesn't change this Complex number). More...
 
Complex exp ()
 Complex exponential (doesn't change this Complex number). More...
 
Complex log ()
 Principal branch of the Complex logarithm of this Complex number. More...
 
Complex sqrt ()
 Complex square root (doesn't change this complex number). More...
 
Complex sin ()
 Sine of this Complex number (doesn't change this Complex number). More...
 
Complex cos ()
 Cosine of this Complex number (doesn't change this Complex number). More...
 
Complex sinh ()
 Hyperbolic sine of this Complex number (doesn't change this Complex number). More...
 
Complex cosh ()
 Hyperbolic cosine of this Complex number (doesn't change this Complex number). More...
 
Complex tan ()
 Tangent of this Complex number (doesn't change this Complex number). More...
 
Complex chs ()
 Negative of this complex number (chs stands for change sign). More...
 
String toString ()
 String representation of this Complex number. More...
 

Detailed Description

Complex implements a complex number and defines complex arithmetic and mathematical functions.

Constructor & Destructor Documentation

Complex ( double  u,
double  v 
)
inline

Constructs the complex number z = u + i*v.

Parameters
uReal part
vImaginary part

Member Function Documentation

double arg ( )
inline

Argument of this Complex number (the angle in radians with the x-axis in polar coordinates).

Returns
arg(z) where z is this Complex number.
Complex chs ( )
inline

Negative of this complex number (chs stands for change sign).

This produces a new Complex number and doesn't change this Complex number.
-(x+i*y) = -x-i*y.

Returns
-z where z is this Complex number.
Complex conj ( )
inline

Complex conjugate of this Complex number (the conjugate of x+i*y is x-i*y).

Returns
z-bar where z is this Complex number.
Complex cos ( )
inline

Cosine of this Complex number (doesn't change this Complex number).


cos(z) = (exp(i*z)+exp(-i*z))/ 2.

Returns
cos(z) where z is this Complex number.
Complex cosh ( )
inline

Hyperbolic cosine of this Complex number (doesn't change this Complex number).


cosh(z) = (exp(z) + exp(-z)) / 2.

Returns
cosh(z) where z is this Complex number.
Complex div ( Complex  w)
inline

Division of Complex numbers (doesn't change this Complex number).


(x+i*y)/(s+i*t) = ((x*s+y*t) + i*(y*s-y*t)) / (s^2+t^2)

Parameters
wis the number to divide by
Returns
new Complex number z/w where z is this Complex number
Complex exp ( )
inline

Complex exponential (doesn't change this Complex number).

Returns
exp(z) where z is this Complex number.
double imag ( )
inline

Imaginary part of this Complex number (the y-coordinate in rectangular coordinates).

Returns
Im[z] where z is this Complex number.
Complex log ( )
inline

Principal branch of the Complex logarithm of this Complex number.

(doesn't change this Complex number). The principal branch is the branch with -pi < arg <= pi.

Returns
log(z) where z is this Complex number.
Complex minus ( Complex  w)
inline

Subtraction of Complex numbers (doesn't change this Complex number).


(x+i*y) - (s+i*t) = (x-s)+i*(y-t).

Parameters
wis the number to subtract.
Returns
z-w where z is this Complex number.
double mod ( )
inline

Modulus of this Complex number (the distance from the origin in polar coordinates).

Returns
|z| where z is this Complex number.
Complex plus ( Complex  w)
inline

Addition of Complex numbers (doesn't change this Complex number).


(x+i*y) + (s+i*t) = (x+s)+i*(y+t).

Parameters
wis the number to add.
Returns
z+w where z is this Complex number.
double real ( )
inline

Real part of this Complex number (the x-coordinate in rectangular coordinates).

Returns
Re[z] where z is this Complex number.
Complex sin ( )
inline

Sine of this Complex number (doesn't change this Complex number).


sin(z) = (exp(i*z)-exp(-i*z))/(2*i).

Returns
sin(z) where z is this Complex number.
Complex sinh ( )
inline

Hyperbolic sine of this Complex number (doesn't change this Complex number).


sinh(z) = (exp(z)-exp(-z))/2.

Returns
sinh(z) where z is this Complex number.
Complex sqrt ( )
inline

Complex square root (doesn't change this complex number).

Computes the principal branch of the square root, which is the value with 0 <= arg < pi.

Returns
sqrt(z) where z is this Complex number.
Complex tan ( )
inline

Tangent of this Complex number (doesn't change this Complex number).


tan(z) = sin(z)/cos(z).

Returns
tan(z) where z is this Complex number.
Complex times ( Complex  w)
inline

Complex multiplication (doesn't change this Complex number).

Parameters
wis the number to multiply by.
Returns
z*w where z is this Complex number.
String toString ( )
inline

String representation of this Complex number.

Returns
x+i*y, x-i*y, x, or i*y as appropriate.

The documentation for this class was generated from the following file: