Public Member Functions | |
| Complex () | |
| Complex (Complex z) | |
| Complex (double real) | |
| Complex (double real, double imag) | |
| double | abs () |
| Complex | acos () |
| Complex | acosh () |
| Complex | add (Complex z) |
| Complex | add (double s) |
| double | arg () |
| Complex | asin () |
| Complex | asinh () |
| Complex | atan () |
| Complex | atanh () |
| Complex | cbrt () |
| Complex | conj () |
| Complex | cos () |
| Complex | cosec () |
| Complex | cosech () |
| Complex | cosh () |
| Complex | cot () |
| Complex | coth () |
| Complex | cubed () |
| Complex | div (Complex z) |
| Complex | div (double s) |
| boolean | equals (Complex z) |
| boolean | equals (Object obj) |
| Complex | exp () |
| boolean | isZero () |
| boolean | isReal () |
| Complex | log () |
| double | mag () |
| Complex | mult (Complex z) |
| Complex | mult (double s) |
| Complex | negative () |
| Complex | norm () |
| Complex | pow (Complex z2) |
| Complex | pow (double s) |
| Complex | sin () |
| Complex | sinh () |
| Complex | sqrt () |
| Complex | squared () |
| Complex | sub (Complex z) |
| Complex | sub (double s) |
| Complex | tan () |
| Complex | tanh () |
| String | toString () |
Public Attributes | |
| final double | real |
| final double | imag |
Static Public Attributes | |
| static Complex | ZERO = new Complex() |
Immutable class used to represent complex numbers.
The original author(s) and origin of this class has been lost in time but it has been modified to include both static and instance methods for all calculations, and made immutable.
Peter Lager 2016
| org.qscript.Complex.Complex | ( | ) |
Default constructor Creates the complex number 0 + 0i
| org.qscript.Complex.Complex | ( | Complex | z | ) |
Copy constructor Creates the complex number z.real + z.imag i
| org.qscript.Complex.Complex | ( | double | real | ) |
Constructor Creates the complex number real + 0i
| org.qscript.Complex.Complex | ( | double | real, |
| double | imag | ||
| ) |
Constructor Creates the complex number real + imag i
|
static |
Returns the absolute value or magnitude of a complex number
| double org.qscript.Complex.abs | ( | ) |
Returns the absolute value or magnitude of a complex number
| Complex org.qscript.Complex.acos | ( | ) |
Returns the acos of z
| Complex org.qscript.Complex.acosh | ( | ) |
Returns the acosh
Returns the sum of 2 complex numbers
Returns the sum of a complex and a real number
Returns the sum of a real and a complex number
| Complex org.qscript.Complex.add | ( | double | s | ) |
Returns the sum of this number and a scalar number
|
static |
Returns the arg (angle in the complex plane) of a complex number
| double org.qscript.Complex.arg | ( | ) |
Returns the arg (angle in the complex plane)
| Complex org.qscript.Complex.asin | ( | ) |
Returns the asin
| Complex org.qscript.Complex.asinh | ( | ) |
Returns the asinh
| Complex org.qscript.Complex.atan | ( | ) |
Returns the atan
| Complex org.qscript.Complex.atanh | ( | ) |
Returns the atanh
| Complex org.qscript.Complex.cbrt | ( | ) |
Returns the cube root
| Complex org.qscript.Complex.conj | ( | ) |
Returns the conjugate
| Complex org.qscript.Complex.cos | ( | ) |
Returns the cos
| Complex org.qscript.Complex.cosec | ( | ) |
Returns the cosec
| Complex org.qscript.Complex.cosech | ( | ) |
Returns the cosech
| Complex org.qscript.Complex.cosh | ( | ) |
Returns the cosh
| Complex org.qscript.Complex.cot | ( | ) |
Returns the cot
| Complex org.qscript.Complex.coth | ( | ) |
Returns the coth
| Complex org.qscript.Complex.cubed | ( | ) |
Returns z^3
Returns the result of dividing z1 by z2
Returns the result of dividing z by a scalar
Returns the result of dividing a scalar by z
| Complex org.qscript.Complex.div | ( | double | s | ) |
Divide this by a scalar and return result
| boolean org.qscript.Complex.equals | ( | Complex | z | ) |
Compare 2 complex numbers for equality
| boolean org.qscript.Complex.equals | ( | Object | obj | ) |
Compares two complex numbers for equality
| Complex org.qscript.Complex.exp | ( | ) |
Returns the exponential of this number (e^z)
| boolean org.qscript.Complex.isZero | ( | ) |
Returns true is both real and imaginary parts are less than E
Linear interpretation between 2 complex numbers
| Complex org.qscript.Complex.log | ( | ) |
Returns the natural log of z
| double org.qscript.Complex.mag | ( | ) |
Multiply this by z and return the result
Returns z1 multiplied by z2
Returns a complex number multiplied by a scalar
Returns a scalar multiplied by a complex number
| Complex org.qscript.Complex.mult | ( | double | s | ) |
Multiply this by a scalar and return result
| Complex org.qscript.Complex.negative | ( | ) |
Returns the negative value
Returns a Complex number which is the value of z normalised so the magnitude is 1
| Complex org.qscript.Complex.norm | ( | ) |
Return a complex number of length 1 and the same angle
Returns this number raised to the power of z2
Returns this number raised to the power of a scalar
| Complex org.qscript.Complex.pow | ( | double | s | ) |
Returns z raised to the power of a scalar
| Complex org.qscript.Complex.sin | ( | ) |
Returns the sin of z
| Complex org.qscript.Complex.sinh | ( | ) |
Returns the sinh
| Complex org.qscript.Complex.sqrt | ( | ) |
Returns the square root of z
| Complex org.qscript.Complex.squared | ( | ) |
Returns z^2
Returns difference between z1 and z2
Returns the result of subtracting a complex number from this number
| Complex org.qscript.Complex.sub | ( | double | s | ) |
Returns the result of subtracting a scalar number from this number
| Complex org.qscript.Complex.tan | ( | ) |
Returns the tan
| Complex org.qscript.Complex.tanh | ( | ) |
Returns the tanh
| String org.qscript.Complex.toString | ( | ) |
Creates a string representation of this complex number
1.8.5