FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
or by using one of the static from functions on Quaternion:
Quaternion q := Quaternion(3.1, 5.0, 0.1, 2.); // 3.1 + 5i + 0.1j + 2k
There are also a number of convenince functions to return certain constants as Quaternions.
Quaternion c := Quaternion.fromComplex(Complex(1., 1.)); // 1 + i
Action summary | |
---|---|
com.apamax.Quaternion | static add(com.apamax.Quaternion a, com.apamax.Quaternion b)
Add two quaternions and return a new Quaternion with the result. |
boolean |
bitEquals(com.apamax.Quaternion b)
Returns true if all parts of this Quaternion are bit-equals to the corresponding parts of the argument. |
com.apamax.Quaternion | static conjugate(com.apamax.Quaternion a)
Return a new Quaternion which is the complex conjugate of the argument. |
com.apamax.Quaternion | static crossProduct(com.apamax.Quaternion a, com.apamax.Quaternion b)
Calculate the cross product of two Quaternions. If the Quaternions are not vector quaternions, the resultant scalar part will be the product of the scalar parts of the quaternions. |
com.apamax.Quaternion | static divideReal(com.apamax.Quaternion a, float b)
Divide the given Quaternion by a real divisor and return the result as a new Quaternion. |
float | static dotProduct(com.apamax.Quaternion a, com.apamax.Quaternion b)
Calculate the dot product of two vector Quaternions. This ignores the scalar part of the Quaternions. |
com.apamax.Quaternion | static E()
Returns Euler's number e, represented as a quaternion. |
com.apamax.Quaternion | static exp(com.apamax.Quaternion a)
Exponentiate the argument and return the result as a new Quaternion |
string |
formatFixed(integer dp)
Return the Quaternion as a string with a fixed number of decimal places. e.g. 0.30j-4.51k |
string |
formatScientific(integer sf)
Return the Quaternion as a string in scientific notation e.g. 1.3e-2+5.6e10j |
com.apamax.Quaternion | static fromComplex(com.apamax.Complex c)
Creates a Quaternion from a Complex number, with the j and k parts 0. |
com.apamax.Quaternion | static fromIFloat(float i)
Creates a Quaternion with the given float as i and the other parts 0. |
com.apamax.Quaternion | static fromJFloat(float j)
Creates a Quaternion with the given float as i and the other parts 0. |
com.apamax.Quaternion | static fromKFloat(float k)
Creates a Quaternion with the given float as k and the other parts 0. |
com.apamax.Quaternion | static fromRealFloat(float r)
Creates a Quaternion with the given float as the real part and the other parts 0. |
float |
getI()
Returns the i part of this Quaternion. |
float |
getJ()
Returns the j part of this Quaternion. |
float |
getK()
Returns the k part of this Quaternion. |
com.apamax.Quaternion | static I()
Returns the square root of -1, i, represented as a quaternion. |
com.apamax.Quaternion | static INFINITY()
Returns infinity + infinity*i, represented as a quaternion. |
boolean |
isFinite()
Returns true if all parts of this Quaternion are finite. |
boolean |
isInfinite()
Returns true if any part of this Quaternion is infinite. |
boolean |
isNaN()
Returns true if any part of this Quaternion is not a number. |
com.apamax.Quaternion | static ln(com.apamax.Quaternion a)
Return the natural log of the argument as a new Quaternion. |
com.apamax.Quaternion | static multiply(com.apamax.Quaternion a, com.apamax.Quaternion b)
Multiply two quaternions and return a new Quaternion with the result. Since multiplication on quaternions is not commutative a*b is not b*a for all cases. This also means that a/b is ambiguous, since it could mean a(b^-1) or (b^-1)a. To divide use multiply and reciprocal in conjuction to specify the order. |
com.apamax.Quaternion | static multiplyReal(com.apamax.Quaternion a, float b)
Multiply the given Quaternion by a real divisor and return the result as a new Quaternion. |
com.apamax.Quaternion | static NAN()
Returns a Quaternion which is not a number. |
com.apamax.Quaternion | static negate(com.apamax.Quaternion a)
Return a new Quaternion which is the negation of the argument. |
float |
norm()
Return the norm of this Quaternion. |
com.apamax.Quaternion | static ONE()
Returns 1, represented as a quaternion. |
com.apamax.Quaternion | static PI()
Returns the constant pi, represented as a quaternion. |
com.apamax.Quaternion | static powReal(com.apamax.Quaternion a, float b)
Return a Quaternion raised to the power of a real as a new Quaternion |
com.apamax.Quaternion | static reciprocal(com.apamax.Quaternion a)
Return a new Quaternion which is the reciprocal of the argument. |
float |
scalar()
Returns the real/scalar part of this Quaternion. |
com.apamax.Quaternion | static subtract(com.apamax.Quaternion a, com.apamax.Quaternion b)
Subtract two quaternions and return a new Quaternion with the result. |
string |
toValueString()
Return the Quaternion as a string. e.g. 0.3-4.5i |
com.apamax.Quaternion |
uadd(com.apamax.Quaternion b)
Set this Complex number to add the argument and return self. |
com.apamax.Quaternion |
uconjugate()
Assign this to its complex conjugate and return self. |
com.apamax.Quaternion |
udivideReal(float b)
Set this Quaternion to be divided by the real argument and return self. |
com.apamax.Quaternion |
uexp()
Exponentiate this Quaternion and return self. |
com.apamax.Quaternion |
uln()
Sets this Quaternion to the natural logarithm of itself and return self. |
com.apamax.Quaternion |
umultiply(com.apamax.Quaternion b)
Set this Quaternion to multiply by the argument and return self. Since multiplication on quaternions is not commutative a*b is not b*a for all cases. This action calculates self*b. This also means that a/b is ambiguous, since it could mean a(b^-1) or (b^-1)a. To divide use umultiply and ureciprocal in conjuction to specify the order. |
com.apamax.Quaternion |
umultiplyReal(float b)
Set this Quaternion to be multiplied by the real argument and return self. |
com.apamax.Quaternion |
unegate()
Set this Quaternion to its own negation and return self. |
com.apamax.Quaternion |
upowReal(float x)
Raise this Quaternion to the power of a real and return self. |
com.apamax.Quaternion |
ureciprocal()
Set this Complex number to its own reciprocal and return self. |
com.apamax.Quaternion |
usubtract(com.apamax.Quaternion b)
Set this Quaternion to subtract the argument and return self. |
sequence<float> |
vector()
Returns the imaginary/vector parts of this Quaternion. |
com.apamax.Quaternion | static ZERO()
Returns 0, represented as a quaternion. |
Action detail |
---|
com.apamax.Quaternion static add(com.apamax.Quaternion a, com.apamax.Quaternion b)Add two quaternions and return a new Quaternion with the result.
boolean bitEquals(com.apamax.Quaternion b)Returns true if all parts of this Quaternion are bit-equals to the corresponding parts of the argument.
com.apamax.Quaternion static conjugate(com.apamax.Quaternion a)Return a new Quaternion which is the complex conjugate of the argument.
com.apamax.Quaternion static crossProduct(com.apamax.Quaternion a, com.apamax.Quaternion b)Calculate the cross product of two Quaternions. If the Quaternions are not vector quaternions, the resultant scalar part will be the product of the scalar parts of the quaternions.
com.apamax.Quaternion static divideReal(com.apamax.Quaternion a, float b)Divide the given Quaternion by a real divisor and return the result as a new Quaternion.
float static dotProduct(com.apamax.Quaternion a, com.apamax.Quaternion b)Calculate the dot product of two vector Quaternions. This ignores the scalar part of the Quaternions.
com.apamax.Quaternion static E()Returns Euler's number e, represented as a quaternion.
com.apamax.Quaternion static exp(com.apamax.Quaternion a)Exponentiate the argument and return the result as a new Quaternion
string formatFixed(integer dp)Return the Quaternion as a string with a fixed number of decimal places. e.g. 0.30j-4.51k
string formatScientific(integer sf)Return the Quaternion as a string in scientific notation e.g. 1.3e-2+5.6e10j
com.apamax.Quaternion static fromComplex(com.apamax.Complex c)Creates a Quaternion from a Complex number, with the j and k parts 0.
com.apamax.Quaternion static fromIFloat(float i)Creates a Quaternion with the given float as i and the other parts 0.
com.apamax.Quaternion static fromJFloat(float j)Creates a Quaternion with the given float as i and the other parts 0.
com.apamax.Quaternion static fromKFloat(float k)Creates a Quaternion with the given float as k and the other parts 0.
com.apamax.Quaternion static fromRealFloat(float r)Creates a Quaternion with the given float as the real part and the other parts 0.
float getI()Returns the i part of this Quaternion.
float getJ()Returns the j part of this Quaternion.
float getK()Returns the k part of this Quaternion.
com.apamax.Quaternion static I()Returns the square root of -1, i, represented as a quaternion.
com.apamax.Quaternion static INFINITY()Returns infinity + infinity*i, represented as a quaternion.
boolean isFinite()Returns true if all parts of this Quaternion are finite.
boolean isInfinite()Returns true if any part of this Quaternion is infinite.
boolean isNaN()Returns true if any part of this Quaternion is not a number.
com.apamax.Quaternion static ln(com.apamax.Quaternion a)Return the natural log of the argument as a new Quaternion.
com.apamax.Quaternion static multiply(com.apamax.Quaternion a, com.apamax.Quaternion b)Multiply two quaternions and return a new Quaternion with the result. Since multiplication on quaternions is not commutative a*b is not b*a for all cases. This also means that a/b is ambiguous, since it could mean a(b^-1) or (b^-1)a. To divide use multiply and reciprocal in conjuction to specify the order.
com.apamax.Quaternion static multiplyReal(com.apamax.Quaternion a, float b)Multiply the given Quaternion by a real divisor and return the result as a new Quaternion.
com.apamax.Quaternion static NAN()Returns a Quaternion which is not a number.
com.apamax.Quaternion static negate(com.apamax.Quaternion a)Return a new Quaternion which is the negation of the argument.
float norm()Return the norm of this Quaternion.
com.apamax.Quaternion static ONE()Returns 1, represented as a quaternion.
com.apamax.Quaternion static PI()Returns the constant pi, represented as a quaternion.
com.apamax.Quaternion static powReal(com.apamax.Quaternion a, float b)Return a Quaternion raised to the power of a real as a new Quaternion
com.apamax.Quaternion static reciprocal(com.apamax.Quaternion a)Return a new Quaternion which is the reciprocal of the argument.
float scalar()Returns the real/scalar part of this Quaternion.
com.apamax.Quaternion static subtract(com.apamax.Quaternion a, com.apamax.Quaternion b)Subtract two quaternions and return a new Quaternion with the result.
string toValueString()Return the Quaternion as a string. e.g. 0.3-4.5i
com.apamax.Quaternion uadd(com.apamax.Quaternion b)Set this Complex number to add the argument and return self.
com.apamax.Quaternion uconjugate()Assign this to its complex conjugate and return self.
com.apamax.Quaternion udivideReal(float b)Set this Quaternion to be divided by the real argument and return self.
com.apamax.Quaternion uexp()Exponentiate this Quaternion and return self.
com.apamax.Quaternion uln()Sets this Quaternion to the natural logarithm of itself and return self.
com.apamax.Quaternion umultiply(com.apamax.Quaternion b)Set this Quaternion to multiply by the argument and return self. Since multiplication on quaternions is not commutative a*b is not b*a for all cases. This action calculates self*b. This also means that a/b is ambiguous, since it could mean a(b^-1) or (b^-1)a. To divide use umultiply and ureciprocal in conjuction to specify the order.
com.apamax.Quaternion umultiplyReal(float b)Set this Quaternion to be multiplied by the real argument and return self.
com.apamax.Quaternion unegate()Set this Quaternion to its own negation and return self.
com.apamax.Quaternion upowReal(float x)Raise this Quaternion to the power of a real and return self.
com.apamax.Quaternion ureciprocal()Set this Complex number to its own reciprocal and return self.
com.apamax.Quaternion usubtract(com.apamax.Quaternion b)Set this Quaternion to subtract the argument and return self.
sequence<float> vector()Returns the imaginary/vector parts of this Quaternion.
com.apamax.Quaternion static ZERO()Returns 0, represented as a quaternion.
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |