Complex (struct)¶
The Complex type represents a complex number.
/*
** Example: Complex
*/
Complex c(-4.1, 3.14);
Methods¶
Complex ( in Complex other ) | |
Complex ( in SInt32 re ) | |
Complex ( in Scalar re ) | |
Complex ( in Scalar re, in Scalar im ) | |
Complex () | |
Boolean | almostEqual ? ( in Complex that ) |
Boolean | almostEqual ? ( in Complex that, in Scalar precision ) |
Scalar | angle ? () |
appendDesc ? ( io String string ) | |
Complex | clone ? () |
Complex | conj ? () |
Boolean | equal ? ( in Complex that ) |
UInt32 | hash ? () |
Complex | inv ? () |
Boolean | isAlmostZero ? ( in Scalar precision ) |
Boolean | isAlmostZero ? () |
Boolean | isZero ? () |
Scalar | length ? () |
Scalar | lengthSquared ? () |
Complex | linearInterpolate ? ( in Complex that, in Scalar t ) |
Scalar | norm ? () |
Scalar | normSq ? () |
normalize ! () | |
Complex | recip ? () |
Scalar | setUnit ! () |
Complex | unit ? () |
Complex | unit_safe ? () |
Methods in detail¶
copy constructor
Construct a complex number with real value re
Construct a complex number with real value re
Complex ( in Scalar re, in Scalar im )
Construct a complex number with real value re
and
imaginary value im
Complex ()
default constructor
Boolean Complex.almostEqual? ( in Complex that )
Boolean Complex.almostEqual? ( in Complex that, in Scalar precision )
Check if the value of the complex number is equal to that
, within
the specified precision
Return the angle of the complex number from its real and imaginary components
Complex.appendDesc? ( io String string )
Append a String description of this complex number
to the io String string
clone method
Boolean Complex.equal? ( in Complex that )
Return the inverse of this complex number
Boolean Complex.isAlmostZero? ( in Scalar precision )
Check if the value of the complex number is close enough zero, within the specified precision
Boolean Complex.isAlmostZero? ()
Boolean Complex.isZero? ()
Check if the value is zero
Return the length of this complex number
Scalar Complex.lengthSquared? ()
Complex Complex.linearInterpolate? ( in Complex that, in Scalar t )
Linearly interpolates this vector with another one based on a scalar blend value (0.0 to 1.0)
Return the normalized value of this complex number
Complex.normalize! ()
Normalize this complex number
Return the reciprocal of this complex number
Returns the unit vector of this one, throws and exception if almost zero length
Returns the unit vector of this one, with a value of 1 if almost zero length