Options
All
• Public
• Public/Protected
• All

• Geometric3

### Implements

• CartesianG3
• GeometricE3
• LockableMixin
• VectorN<number>

## Constructors

### constructor

• new Geometric3(coords?: [number, number, number, number, number, number, number, number]): Geometric3
• Constructs a `Geometric3`. The multivector is initialized to zero. coords [a, x, y, z, xy, yz, zx, b]

## Properties

### isLocked

isLocked: () => boolean

#### Type declaration

• (): boolean

### lock

lock: () => number

• (): number

### unlock

unlock: (token: number) => void

#### Type declaration

• (token: number): void

#### Returns void

E1: Geometric3 = new Geometric3(vector(1, 0, 0))

The basis element corresponding to the vector `x` coordinate. The multivector is locked (immutable), but may be cloned.

E2: Geometric3 = new Geometric3(vector(0, 1, 0))

The basis element corresponding to the vector `y` coordinate. The multivector is locked (immutable), but may be cloned.

E3: Geometric3 = new Geometric3(vector(0, 0, 1))

The basis element corresponding to the vector `z` coordinate. The multivector is locked (immutable), but may be cloned.

ONE: Geometric3 = new Geometric3(scalar(1))

The identity element for multiplication, `1`. The multivector is locked (immutable), but may be cloned.

PSEUDO: Geometric3 = new Geometric3(pseudo(1))

The basis element corresponding to the pseudoscalar `b` coordinate. The multivector is locked (immutable), but may be cloned.

ZERO: Geometric3 = new Geometric3(scalar(0))

The identity element for addition, `0`. The multivector is locked.

## Accessors

### a

• get a(): number
• set a(a: number): void

### b

• get b(): number
• set b(b: number): void
• The pseudoscalar part of this multivector.

#### Returns number

• The pseudoscalar part of this multivector.

### length

• get length(): number

0x0 = zero 0x1 = scalar 0x2 = vector 0x4 = bivector 0x8 = pseudoscalar

### modified

• get modified(): boolean
• set modified(modified: boolean): void

### x

• get x(): number
• set x(x: number): void
• The coordinate corresponding to the e1 standard basis vector.

#### Returns number

• The coordinate corresponding to the e1 standard basis vector.

### xy

• get xy(): number
• set xy(xy: number): void
• The coordinate corresponding to the e1e2 standard basis bivector.

#### Returns number

• The coordinate corresponding to the e1e2 standard basis bivector.

### y

• get y(): number
• set y(y: number): void
• The coordinate corresponding to the e2 standard basis vector.

#### Returns number

• The coordinate corresponding to the e2 standard basis vector.

### yz

• get yz(): number
• set yz(yz: number): void
• The coordinate corresponding to the e2e3 standard basis bivector.

#### Returns number

• The coordinate corresponding to the e2e3 standard basis bivector.

### z

• get z(): number
• set z(z: number): void
• The coordinate corresponding to the e3 standard basis vector.

#### Returns number

• The coordinate corresponding to the e3 standard basis vector.

### zx

• get zx(): number
• set zx(zx: number): void
• The coordinate corresponding to the e3e1 standard basis bivector.

#### Returns number

• The coordinate corresponding to the e3e1 standard basis bivector.

## Methods

• Adds a multivector value to this multivector with optional scaling.

this ⟼ this + M * alpha

#### Parameters

• ##### M: GeometricE3

The multivector to be added to this multivector.

• ##### Default value alpha: number = 1

An optional scale factor that multiplies the multivector argument.

#### Returns Geometric3

this + M * alpha

• add2(a: GeometricE3, b: GeometricE3): this
• `this ⟼ a + b`

#### Returns this

• Adds a bivector value to this multivector.

this ⟼ this + B

#### Returns Geometric3

this + B

• Adds a pseudoscalar value to this multivector.

this ⟼ this + I * β

#### Parameters

• ##### β: number

The pseudoscalar value to be added to this multivector.

#### Returns Geometric3

this + I * β

• Adds a scalar value to this multivector.

#### Parameters

• ##### alpha: number

The scalar value to be added to this multivector.

#### Returns Geometric3

this + alpha

• addVector(v: VectorE3, alpha?: number): Geometric3
• Adds a vector value to this multivector.

#### Parameters

• ##### Default value alpha: number = 1

The scaling factor for the vector.

#### Returns Geometric3

this + v * alpha

### approx

• Sets any coordinate whose absolute value is less than pow(10, -n) times the absolute value of the largest coordinate.

### arg

#### Returns Geometric3

The arg of `this` multivector.

### conj

• 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)

### copy

• copy(M: GeometricE3): this
• Sets this multivector to be a copy of another multivector.

copy(M)

### copyCoordinates

• copyCoordinates(coordinates: number[]): this
• Copies the coordinate values into this `Geometric3`.

#### Parameters

• ##### coordinates: number[]

The coordinates in order a, x, y, z, yz, zx, xy, b.

### copyScalar

• copyScalar(α: number): this
• Sets this multivector to the value of the scalar, α. The non-scalar components are set to zero.

#### Parameters

• ##### α: number

The scalar to be copied.

### copySpinor

• copySpinor(spinor: SpinorE3): this
• Copies the spinor argument value into this multivector. The non-spinor components are set to zero.

#### Parameters

• ##### spinor: SpinorE3

The spinor to be copied.

### copyVector

• copyVector(vector: VectorE3): this
• Copies the vector argument value into this multivector. The non-vector components are set to zero.

#### Parameters

• ##### vector: VectorE3

The vector to be copied.

### cross

• Sets this multivector to the generalized vector cross product with another multivector.

this ⟼ dual(this ^ m)

### distanceTo

• distanceTo(point: VectorE3): number

### div

• `this ⟼ this / m`

#### Parameters

• ##### m: GeometricE3

The multivector dividend.

this / m

### div2

• div2(a: SpinorE3, b: SpinorE3): this
• this ⟼ a / b

### divByScalar

• Division of this multivector by a scalar.

this / alpha

### divByVector

• this ⟼ this / v

#### Parameters

• ##### v: VectorE3

The vector on the right hand side of the / operator.

this / v

### equals

• equals(other: any): boolean

this ^ m

### ext2

• ext2(a: GeometricE3, b: GeometricE3): this
• Sets this multivector to the outer product of `a` and `b`. this ⟼ a ^ b

### getComponent

• getComponent(i: number): number

If this multivector is mutable (unlocked) then it is set to the result.

#### Parameters

• ##### i: number

The index of the grade to be extracted.

### isOne

• isOne(): boolean

### isZero

• isZero(): boolean

### lco

• Left contraction of this multivector with another multivector.

this << m

### lco2

• lco2(a: GeometricE3, b: GeometricE3): this
• Sets this multivector to a << b

a << b

### lerp

• lerp(target: GeometricE3, α: number): Geometric3

#### Returns Geometric3

this + α * (target - this)

### lerp2

• lerp2(a: GeometricE3, b: GeometricE3, α: number): this
• Linear interpolation. Sets this multivector to a + α * (b - a)

### magnitude

• magnitude(): number

### mul

• this ⟼ this * m

this * m

### mul2

• mul2(a: GeometricE3, b: GeometricE3): this
• this ⟼ a * b

### norm

• 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)

### normalize

• 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.

### one

• one(): this

• Computes the quadrance from this position (vector) to the specified point.

### rco

• rco(m: GeometricE3): this
• Right contraction.

A >> B = grade(A * B, a - b) = `A.rco(B)`

this >> rhs

### rco2

• rco2(a: GeometricE3, b: GeometricE3): this
• `this ⟼ a >> b`

### reflect

• 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.

#### Parameters

• ##### n: VectorE3

The unit vector that defines the reflection plane.

### rotate

• Rotates this multivector using a rotor, R.

#### Returns Geometric3

R * this * reverse(R) = R * this * ~R

### rotorFromAxisAngle

• rotorFromAxisAngle(axis: VectorE3, θ: number): this
• Sets this multivector to a rotor that rotates through angle θ around the specified axis.

#### Parameters

• ##### axis: VectorE3

The (unit) vector defining the rotation direction.

• ##### θ: number

The rotation angle in radians when the rotor is applied on both sides as R * M * ~R

### rotorFromDirections

• rotorFromDirections(a: VectorE3, b: VectorE3): this
• 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.

#### Parameters

• ##### a: VectorE3

The starting vector

• ##### b: VectorE3

The ending vector

#### Returns this

The rotor representing a rotation from a to b.

### rotorFromFrameToFrame

• rotorFromFrameToFrame(es: VectorE3[], fs: VectorE3[]): this

### rotorFromGeneratorAngle

• rotorFromGeneratorAngle(B: BivectorE3, θ: number): this
• 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|

#### Parameters

• ##### B: BivectorE3

The (unit) bivector generating the rotation.

• ##### θ: number

The rotation angle in radians when the rotor is applied on both sides as R * M * ~R

### rotorFromVectorToVector

• rotorFromVectorToVector(a: VectorE3, b: VectorE3, B: BivectorE3 | undefined): this
• R = (|b||a| + b * a) / sqrt(2 * |b||a|(|b||a| + b << a))

The result is independent of the magnitudes of a and b.

### scale

• this ⟼ this * alpha

### scp

• Scalar Product

#### Returns Geometric3

scp(this, rhs) = this | rhs

### scp2

• scp2(a: GeometricE3, b: GeometricE3): this
• this ⟼ scp(a, b) = a | b

### squaredNorm

• 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

#### Returns Geometric3

squaredNorm(this)

### stress

• Applies the diagonal elements of a scaling matrix to this multivector.

this - M * α

### sub2

• sub2(a: GeometricE3, b: GeometricE3): this
• `this ⟼ a - b`

### subVector

• `this ⟼ this - v * α`

this - v * α

### toArray

• toArray(): number[]

### toExponential

• toExponential(fractionDigits?: number): string
• Returns a string representing the number in exponential notation.

### toFixed

• toFixed(fractionDigits?: number): string
• Returns a string representing the number in fixed-point notation.

### toPrecision

• toPrecision(precision?: number): string

### toString

• Returns a string representation of this multivector.

### versor

• versor(a: VectorE3, b: VectorE3): this
• Sets this multivector to the geometric product of the arguments. This multivector must be mutable (in the unlocked state).

this ⟼ a * b

#### Parameters

• ##### a: VectorE3

The vector on the left of the operator.

• ##### b: VectorE3

The vector on the right of the operator.

#### Returns this

the geometric product, a * b, of the vector arguments.

• zero(): this

### Static bivector

• bivector(yz: number, zx: number, xy: number): Geometric3
• Constructs a mutable bivector with the coordinates `yz`, `zx`, and `xy`.

### Static copy

• Constructs a mutable multivector by copying a multivector.

### Static dualOfBivector

• Constructs a mutable multivector which is the dual of the bivector `B`.

### Static dualOfVector

• Constructs a mutable multivector which is the dual of the vector `v`.

### Static e1

• Constructs the basis vector e1. Locking the vector prevents mutation.

### Static e2

• Constructs the basis vector e2. Locking the vector prevents mutation.

### Static e3

• Constructs the basis vector e3. Locking the vector prevents mutation.

### Static fromBivector

• Constructs a mutable multivector by copying the bivector `B`.

### Static fromScalar

• Constructs a mutable multivector by copying the scalar `α`.

### Static fromSpinor

• Constructs a mutable multivector by copying the spinor `s`.

### Static fromVector

• Constructs a mutable multivector by copying the vector `v`.

### Static lerp

• lerp(A: GeometricE3, B: GeometricE3, α: number): Geometric3
• Constructs a mutable multivector that linearly interpolates `A` and `B`, A + α * (B - A)

### Static pseudo

• Constructs a mutable pseudoscalar with the magnitude `β`.

### Static random

• random(lowerBound?: number, upperBound?: number): Geometric3
• Computes a multivector with random components in the range [lowerBound, upperBound].

### Static rotorFromDirections

• rotorFromDirections(a: VectorE3, b: VectorE3): Geometric3
• Computes the rotor that rotates vector `a` to vector `b`. The result is independent of the magnitudes of `a` and `b`.

### Static rotorFromFrameToFrame

• rotorFromFrameToFrame(es: VectorE3[], fs: VectorE3[]): Geometric3

### Static rotorFromVectorToVector

• rotorFromVectorToVector(a: VectorE3, b: VectorE3, B: BivectorE3): Geometric3
• 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`.

### Static scalar

• Constructs a mutable scalar with the magnitude `α`.

### Static spinor

• spinor(yz: number, zx: number, xy: number, α: number): Geometric3
• Constructs a mutable scalar with the coordinates `yz`, `zx`, `xy`, and `α`.

### Static vector

• vector(x: number, y: number, z: number): Geometric3
• Constructs a mutable vector with the coordinates `x`, `y`, and `z`.

### Static wedge

• Constructs a mutable bivector as the outer product of two vectors.

## Legend

• Constructor
• Property
• Method
• Accessor
• Inherited property
• Inherited method
• Inherited accessor
• Property
• Method
• Protected property
• Protected method
• Static property
• Static method

Generated using TypeDoc