Static
Readonly
E1The basis element corresponding to the vector x
coordinate.
The multivector is locked (immutable), but may be cloned.
Static
Readonly
E2The basis element corresponding to the vector y
coordinate.
The multivector is locked (immutable), but may be cloned.
Static
Readonly
E3The basis element corresponding to the vector z
coordinate.
The multivector is locked (immutable), but may be cloned.
Static
Readonly
ONEThe identity element for multiplication, 1
.
The multivector is locked (immutable), but may be cloned.
Static
Readonly
PSEUDOThe basis element corresponding to the pseudoscalar b
coordinate.
The multivector is locked (immutable), but may be cloned.
Static
Readonly
ZEROThe identity element for addition, 0
.
The multivector is locked.
The scalar part of this multivector.
The pseudoscalar part of this multivector.
A bitmask describing the grades.
0x0 = zero 0x1 = scalar 0x2 = vector 0x4 = bivector 0x8 = pseudoscalar
The coordinate corresponding to the e1 standard basis vector.
The coordinate corresponding to the e1e2 standard basis bivector.
The coordinate corresponding to the e2 standard basis vector.
The coordinate corresponding to the e2e3 standard basis bivector.
The coordinate corresponding to the e3 standard basis vector.
The coordinate corresponding to the e3e1 standard basis bivector.
Adds a multivector value to this multivector with optional scaling.
this ⟼ this + M * alpha
The multivector to be added to this multivector.
An optional scale factor that multiplies the multivector argument.
this + M * alpha
this ⟼ a + b
Adds a bivector value to this multivector.
this ⟼ this + B
this + B
Adds a pseudoscalar value to this multivector.
this ⟼ this + I * β
The pseudoscalar value to be added to this multivector.
this + I * β
Adds a scalar value to this multivector.
The scalar value to be added to this multivector.
this + alpha
Adds a vector value to this multivector.
The vector to be added.
The scaling factor for the vector.
this + v * alpha
Sets any coordinate whose absolute value is less than pow(10, -n) times the absolute value of the largest coordinate.
arg(A) = grade(log(A), 2)
The arg of this
multivector.
copy(this)
The Clifford conjugate. The multiplier for the grade x is (-1) raised to the power x * (x + 1) / 2 The pattern of grades is +--++--+
conj(this)
Sets this multivector to be a copy of another multivector.
copy(M)
Copies the spinor argument value into this multivector. The non-spinor components are set to zero.
The spinor to be copied.
Copies the vector argument value into this multivector. The non-vector components are set to zero.
The vector to be copied.
Sets this multivector to the generalized vector cross product with another multivector.
this ⟼ dual(this ^ m)
this / magnitude(this)
this ⟼ this / m
The multivector dividend.
this / m
Division of this multivector by a scalar.
this / alpha
this ⟼ this / v
The vector on the right hand side of the / operator.
this / v
this ⟼ exp(this)
this ^ m
Sets this multivector to the outer product of a
and b
.
this ⟼ a ^ b
Extraction of grade i.
If this multivector is mutable (unlocked) then it is set to the result.
The index of the grade to be extracted.
inverse(this)
Left contraction of this multivector with another multivector.
this << m
Sets this multivector to a << b
a << b
this + α * (target - this)
Linear interpolation. Sets this multivector to a + α * (b - a)
this ⟼ log(this)
log(this)
this ⟼ this * m
this * m
this ⟼ a * b
this ⟼ -1 * this
-1 * this
norm(A) = |A| = A | ~A, where | is the scalar product and ~ is reversion.
this ⟼ magnitude(this) = sqrt(scp(this, rev(this))) = sqrt(this | ~this)
norm(this)
this ⟼ this / magnitude(this)
If the magnitude is zero (a null multivector), this multivector is unchanged. Since the metric is Euclidean, this will only happen if the multivector is also the zero multivector.
Computes the quadrance from this position (vector) to the specified point.
Right contraction.
A >> B = grade(A * B, a - b) = A.rco(B)
this >> rhs
this ⟼ a >> b
Sets this multivector to its reflection in the plane orthogonal to vector n.
Mathematically,
this ⟼ - n * this * n
Geometrically,
Reflects this multivector in the plane orthogonal to the unit vector, n.
If n is not a unit vector then the result is scaled by n squared.
The unit vector that defines the reflection plane.
this ⟼ reverse(this)
Rotates this multivector using a rotor, R.
R * this * reverse(R) = R * this * ~R
Sets this multivector to a rotor that rotates through angle θ around the specified axis.
The (unit) vector defining the rotation direction.
The rotation angle in radians when the rotor is applied on both sides as R * M * ~R
Sets this multivector to a rotor that rotates through angle θ in the oriented plane defined by B.
this ⟼ exp(- B * θ / 2) = cos(|B| * θ / 2) - B * sin(|B| * θ / 2) / |B|
The (unit) bivector generating the rotation.
The rotation angle in radians when the rotor is applied on both sides as R * M * ~R
R = (|b||a| + b * a) / sqrt(2 * |b||a|(|b||a| + b << a))
The result is independent of the magnitudes of a and b.
this ⟼ this * alpha
Scalar Product
scp(this, rhs) = this | rhs
this ⟼ scp(a, b) = a | b
squaredNorm(A) = |A||A| = A | ~A
Returns the (squared) norm of this multivector.
If this multivector is mutable (unlocked), then it is set to the squared norm of this multivector, and the return value is this multivector. If thus multivector is immutable (locked), then a new multivector is returned which is also immutable.
this ⟼ squaredNorm(this) = scp(this, rev(this)) = this | ~this
squaredNorm(this)
Applies the diagonal elements of a scaling matrix to this multivector.
this - M * α
this ⟼ a - b
this ⟼ this - v * α
this - v * α
Static
bivectorConstructs a mutable bivector with the coordinates yz
, zx
, and xy
.
Static
copyConstructs a mutable multivector by copying a multivector.
Static
dualConstructs a mutable multivector which is the dual of the bivector B
.
Static
dualConstructs a mutable multivector which is the dual of the vector v
.
Static
e1Constructs the basis vector e1. Locking the vector prevents mutation.
Static
e2Constructs the basis vector e2. Locking the vector prevents mutation.
Static
e3Constructs the basis vector e3. Locking the vector prevents mutation.
Static
fromConstructs a mutable multivector by copying the bivector B
.
Static
fromConstructs a mutable multivector by copying the scalar α
.
Static
fromConstructs a mutable multivector by copying the spinor s
.
Static
fromConstructs a mutable multivector by copying the vector v
.
Static
IStatic
lerpConstructs a mutable multivector that linearly interpolates A
and B
, A + α * (B - A)
Static
oneStatic
pseudoConstructs a mutable pseudoscalar with the magnitude β
.
Static
randomComputes a multivector with random components in the range [lowerBound, upperBound].
Static
rotorComputes the rotor that rotates vector a
to vector b
.
The result is independent of the magnitudes of a
and b
.
Static
rotorStatic
rotorComputes the rotor that rotates vector a
to vector b
.
The bivector B provides the plane of rotation when a
and b
are anti-aligned.
The result is independent of the magnitudes of a
and b
.
Static
scalarConstructs a mutable scalar with the magnitude α
.
Static
spinorConstructs a mutable scalar with the coordinates yz
, zx
, xy
, and α
.
Static
vectorConstructs a mutable vector with the coordinates x
, y
, and z
.
Static
wedgeConstructs a mutable bivector as the outer product of two vectors.
Static
zero
Constructs a
Geometric3
. The multivector is initialized to zero. coords [a, x, y, z, xy, yz, zx, b]