Complex_d (struct)¶
The Complex_d type represents a complex number.
/*
** Example: Complex_d
*/
Complex_d c(-4.1, 3.14);
Methods¶
Complex_d ( in Complex_d other ) | |
Complex_d ( in Float64 re ) | |
Complex_d ( in Float64 re, in Float64 im ) | |
Complex_d ( in SInt32 re ) | |
Complex_d () | |
Boolean | almostEqual ? ( in Complex_d that ) |
Boolean | almostEqual ? ( in Complex_d that, in Float64 precision ) |
Float64 | angle ? () |
appendDesc ? ( io String string ) | |
Complex_d | clone ? () |
Complex_d | conj ? () |
Boolean | equal ? ( in Complex_d that ) |
UInt32 | hash ? () |
Complex_d | inv ? () |
Boolean | isAlmostZero ? ( in Float64 precision ) |
Boolean | isAlmostZero ? () |
Boolean | isZero ? () |
Float64 | length ? () |
Float64 | lengthSquared ? () |
Complex_d | linearInterpolate ? ( in Complex_d that, in Float64 t ) |
Float64 | norm ? () |
Float64 | normSq ? () |
normalize ! () | |
Complex_d | recip ? () |
Float64 | setUnit ! () |
Complex_d | unit ? () |
Complex_d | unit_safe ? () |
Methods in detail¶
Complex_d ( in Complex_d other )
copy constructor
Construct a complex number with real value re
Complex_d ( in Float64 re, in Float64 im )
Construct a complex number with real value re
and
imaginary value im
Construct a complex number with real value re
Complex_d ()
default constructor
Boolean Complex_d.almostEqual? ( in Complex_d that )
Boolean Complex_d.almostEqual? ( in Complex_d that, in Float64 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_d.appendDesc? ( io String string )
Append a String description of this complex number
to the io String string
clone method
Boolean Complex_d.equal? ( in Complex_d that )
Return the inverse of this complex number
Boolean Complex_d.isAlmostZero? ( in Float64 precision )
Check if the value of the complex number is close enough zero, within the specified precision
Boolean Complex_d.isAlmostZero? ()
Boolean Complex_d.isZero? ()
Check if the value is zero
Return the length of this complex number
Float64 Complex_d.lengthSquared? ()
Complex_d Complex_d.linearInterpolate? ( in Complex_d that, in Float64 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_d.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
Complex_d Complex_d.unit_safe? ()
Returns the unit vector of this one, with a value of 1 if almost zero length