- Inherits from:
- Object
- Conforms to:
- DSimpleArithmetic, DTextable
- Declared in:
- DComplex.h
Object
|
+---DComplex
Class Description
The complex class implements a number of methods for working with complex numbers.
Heavily 'inspired' by the excellent ccmath library by Daniel A. Atkinson (c) Copyright 2000.
- Last modified:
- 29-Mar-2005 (DComplex.h)
Instance Variables
- private double _re
- private double _im
- Constructors
- - (DComplex *) init
- Initialise to complex number zero
- Returns:
- the object
- - (DComplex *) init :(double) re :(double) im
- Initialise to a complex number
- Parameters:
- re - the real part
im - the imaginary part
- Returns:
- the object
- Member methods
- - (double) im
- Get the imaginary part of the number
- Returns:
- the imaginary part
- - (DComplex *) im :(double) im
- Set the imaginary part of the number
- Parameters:
- im - the imaginary part
- Returns:
- the object
- - (DComplex *) move :(DComplex *) other
- Move an other object in this object
- Parameters:
- other - the other object
- Returns:
- this object
- - (double) re
- Get the real part
- Returns:
- the real part
- - (DComplex *) re :(double) re
- Set the real part
- Parameters:
- re - the real part of a complex number
- Returns:
- the object
- - (DComplex *) set :(double) re :(double) im
- Set the real and imaginary part of the number
- Parameters:
- re - the real part
im - the imaginary part
- Returns:
- the object
- Methods on complex numbers
- - (double) abs
- Calculate the modulus of the complex number
- Returns:
- the modulus
- - (DComplex *) acos
- Calculate the inverse trigonometric function cosine for the complex number
- Returns:
- the object
- - (DComplex *) acosh
- Calculate the inverse hyperbolic function cosine for the complex number
- Returns:
- the object
- - (DComplex *) add :(DComplex *) other
- Add with a complex number
- Parameters:
- other - the complex number
- Returns:
- the object
- - (DComplex *) add :(DComplex *) src1 :(DComplex *) src2
- Add two complex numbers and store the result in the object
- Parameters:
- src1 - the first complex number
src2 - the second complex number
- Returns:
- the object
- - (DComplex *) asin
- Calculate the inverse trigonometric function sine for the complex number
- Returns:
- the object
- - (DComplex *) asinh
- Calculate the inverse hyperbolic function sine for the complex number
- Returns:
- the object
- - (DComplex *) atan
- Calculate the inverse trigonometric function tangent for the complex number
- Returns:
- the object
- - (DComplex *) atanh
- Calculate the inverse hyperbolic function tangent for the complex number
- Returns:
- the object
- - (DComplex *) cng
- Conjugate the complex number
- Returns:
- the object
- - (DComplex *) cos
- Calculate the trigonometric functions cosine for the complex number
- Returns:
- the object
- - (DComplex *) cosh
- Calculate the hyperbolic function cosine for the complex number
- Returns:
- the object
- - (DComplex *) div :(DComplex *) other
- Divide with a complex number
- Parameters:
- other - the divider
- Returns:
- the object
- - (DComplex *) div :(DComplex *) src1 :(DComplex *) src2
- Divide two complex numbers and store the result in the object
- Parameters:
- src1 - the first complex number
src2 - the divider
- Returns:
- the object
- - (DComplex *) exp
- Calculate the exponent function for the complex number
- Returns:
- the object
- - (DComplex *) imul :(double) im
- Multiply with a imaginary number
- Parameters:
- im - the imaginary number
- Returns:
- the object
- - (DComplex *) log
- Calculate the natural logarithm for the complex number
- Returns:
- the object
- - (DComplex *) mul :(DComplex *) other
- Multiply with an other complex number
- Parameters:
- other - the complex number
- Returns:
- the object
- - (DComplex *) mul :(DComplex *) src1 :(DComplex *) src2
- Multiply two complex numbers and store the result in the object
- Parameters:
- src1 - the first complex number
src2 - the second complex number
- Returns:
- the object
- - (double) nrm
- Calculate the square of the modulus of the complex number
- Returns:
- the square of the modulus
- - (DComplex *) rmul :(double) re
- Multiply with a real number
- Parameters:
- re - the real number
- Returns:
- the object
- - (DComplex *) sin
- Calculate the trigonometric functions sine for the complex number
- Returns:
- the object
- - (DComplex *) sinh
- Calculate the hyperbolic function sine for the complex number
- Returns:
- the object
- - (DComplex *) sqrt
- Calculate the square root for the complex number
- Returns:
- the object
- - (DComplex *) sub :(DComplex *) other
- Subract with a complex number
- Parameters:
- other - the complex number
- Returns:
- the object
- - (DComplex *) sub :(DComplex *) src1 :(DComplex *) src2
- Subract two complex numbers and store the result in the object
- Parameters:
- src1 - the first complex number
src2 - the second complex number
- Returns:
- the object
- - (DComplex *) tan
- Calculate the trigonometric functions trangent for the complex number
- Returns:
- the object
- - (DComplex *) tanh
- Calculate the hyperbolic function tangent for the complex number
- Returns:
- the object
- Textable protocol methods
- - (DText *) toText
- Convert to a text string
- Returns:
- a (new) text string with the complex number
generated 08-Jan-2006 by ObjcDoc 3.0.0