The basis element corresponding to the vector x
coordinate.
The multivector is locked (immutable), but may be cloned.
The basis element corresponding to the vector y
coordinate.
The multivector is locked (immutable), but may be cloned.
The basis element corresponding to the vector z
coordinate.
The multivector is locked (immutable), but may be cloned.
The identity element for multiplication, 1
.
The multivector is locked (immutable), but may be cloned.
The basis element corresponding to the pseudoscalar b
coordinate.
The multivector is locked (immutable), but may be cloned.
The identity element for addition, 0
.
The multivector is locked.
The scalar part of this multivector.
The scalar part of this multivector.
The pseudoscalar 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 e1 standard basis vector.
The coordinate corresponding to the e1e2 standard basis bivector.
The coordinate corresponding to the e1e2 standard basis bivector.
The coordinate corresponding to the e2 standard basis vector.
The coordinate corresponding to the e2 standard basis vector.
The coordinate corresponding to the e2e3 standard basis bivector.
The coordinate corresponding to the e2e3 standard basis bivector.
The coordinate corresponding to the e3 standard basis vector.
The coordinate corresponding to the e3 standard basis vector.
The coordinate corresponding to the e3e1 standard basis bivector.
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 coordinate values into this Geometric3
.
The coordinates in order a, x, y, z, yz, zx, xy, b.
Sets this multivector to the value of the scalar, α. The non-scalar components are set to zero.
The scalar to be copied.
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
this ⟼ a / b
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)
Determins whether this multivector is exactly zero.
Determins whether this multivector is exactly one.
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)
magnitude(this) = sqrt(this | ~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.
Sets this multivector to the identity element for multiplication, 1.
Computes the square of the magnitude.
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
Computes a rotor, R, from two unit vectors, where R = (|b||a| + b * a) / sqrt(2 * |b||a|(|b||a| + b << a))
The result is independent of the magnitudes of a and b.
The starting vector
The ending vector
The rotor representing a rotation from a to b.
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 * α
Returns a string representing the number in exponential notation.
Returns a string representing the number in fixed-point notation.
Returns a string representation of this multivector.
Sets this multivector to the geometric product of the arguments. This multivector must be mutable (in the unlocked state).
this ⟼ a * b
The vector on the left of the operator.
The vector on the right of the operator.
the geometric product, a * b, of the vector arguments.
Sets this multivector to the identity element for addition, 0.
Constructs a mutable bivector with the coordinates yz
, zx
, and xy
.
Constructs a mutable multivector by copying a multivector.
Constructs a mutable multivector which is the dual of the bivector B
.
Constructs a mutable multivector which is the dual of the vector v
.
Constructs the basis vector e1. Locking the vector prevents mutation.
Constructs the basis vector e2. Locking the vector prevents mutation.
Constructs the basis vector e3. Locking the vector prevents mutation.
Constructs a mutable multivector by copying the bivector B
.
Constructs a mutable multivector by copying the scalar α
.
Constructs a mutable multivector by copying the spinor s
.
Constructs a mutable multivector by copying the vector v
.
Constructs a mutable multivector that linearly interpolates A
and B
, A + α * (B - A)
Constructs a mutable pseudoscalar with the magnitude β
.
Computes a multivector with random components in the range [lowerBound, upperBound].
Computes the rotor that rotates vector a
to vector b
.
The result is independent of the magnitudes of a
and b
.
Computes 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
.
Constructs a mutable scalar with the magnitude α
.
Constructs a mutable scalar with the coordinates yz
, zx
, xy
, and α
.
Constructs a mutable vector with the coordinates x
, y
, and z
.
Constructs a mutable bivector as the outer product of two vectors.
Generated using TypeDoc
Constructs a
Geometric3
. The multivector is initialized to zero. coords [a, x, y, z, xy, yz, zx, b]