Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Geometric3

Implements

  • CartesianG3
  • GeometricE3
  • LockableMixin
  • VectorN<number>

Index

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]

    Parameters

    • Default value coords: [number, number, number, number, number, number, number, number] = [0, 0, 0, 0, 0, 0, 0, 0]

    Returns Geometric3

Properties

isLocked

isLocked: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

lock

lock: () => number

Type declaration

    • (): number
    • Returns number

unlock

unlock: (token: number) => void

Type declaration

    • (token: number): void
    • Parameters

      • token: number

      Returns void

Static Readonly E1

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.

Static Readonly E2

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.

Static Readonly E3

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.

Static Readonly ONE

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

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

Static Readonly PSEUDO

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

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

Static Readonly ZERO

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

length

  • get length(): number

maskG3

  • get maskG3(): number
  • A bitmask describing the grades.

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

    Returns number

modified

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

x

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

xy

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

y

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

yz

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

z

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

zx

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

Methods

add

  • 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

  • add2(a: GeometricE3, b: GeometricE3): this

addBivector

addPseudo

  • 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 * β

addScalar

addVector

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

    Parameters

    • v: VectorE3

      The vector to be added.

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

    Parameters

    • n: number

    Returns Geometric3

arg

clone

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 +--++--+

    Returns Geometric3

    conj(this)

copy

  • copy(M: GeometricE3): this

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.

    Returns this

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.

    Returns this

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.

    Returns this

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.

    Returns this

cross

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

    this ⟼ dual(this ^ m)

    Parameters

    • m: GeometricE3

    Returns Geometric3

direction

distanceTo

  • distanceTo(point: VectorE3): number

div

div2

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

divByScalar

divByVector

dual

equals

  • equals(other: any): boolean

exp

ext

ext2

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

    Parameters

    • a: GeometricE3
    • b: GeometricE3

    Returns this

getComponent

  • getComponent(i: number): number

grade

  • Extraction of grade i.

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

    Parameters

    • i: number

      The index of the grade to be extracted.

    Returns Geometric3

inv

isOne

  • isOne(): boolean

isZero

  • isZero(): boolean

lco

lco2

  • lco2(a: GeometricE3, b: GeometricE3): this

lerp

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

lerp2

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

    Parameters

    • a: GeometricE3
    • b: GeometricE3
    • α: number

    Returns this

log

magnitude

  • magnitude(): number

mul

mul2

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

neg

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)

    Returns Geometric3

    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.

    Returns Geometric3

one

  • one(): this

quaditude

  • quaditude(): number

quadranceTo

  • quadranceTo(point: VectorE3): number
  • Computes the quadrance from this position (vector) to the specified point.

    Parameters

    • point: VectorE3

    Returns number

rco

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

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

    Parameters

    • m: GeometricE3

    Returns this

    this >> rhs

rco2

  • rco2(a: GeometricE3, b: GeometricE3): this

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.

    Returns Geometric3

rev

rotate

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

    Returns this

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

    Returns this

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.

    Parameters

    • a: VectorE3
    • b: VectorE3
    • B: BivectorE3 | undefined

    Returns this

scale

scp

scp2

  • scp2(a: GeometricE3, b: GeometricE3): this

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

sub

sub2

  • sub2(a: GeometricE3, b: GeometricE3): this

subVector

toArray

  • toArray(): number[]

toExponential

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

    Parameters

    • Optional fractionDigits: number

    Returns string

toFixed

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

    Parameters

    • Optional fractionDigits: number

    Returns string

toPrecision

  • toPrecision(precision?: number): string

toString

  • toString(radix?: number): string

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

  • zero(): this

Static I

Static bivector

  • bivector(yz: number, zx: number, xy: number): Geometric3

Static copy

Static dualOfBivector

Static dualOfVector

Static e1

Static e2

Static e3

Static fromBivector

Static fromScalar

Static fromSpinor

Static fromVector

Static lerp

  • lerp(A: GeometricE3, B: GeometricE3, α: number): Geometric3

Static one

Static pseudo

Static random

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

    Parameters

    • Default value lowerBound: number = -1
    • Default value upperBound: number = +1

    Returns Geometric3

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.

    Parameters

    • a: VectorE3
    • b: VectorE3

    Returns Geometric3

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.

    Parameters

    • a: VectorE3
    • b: VectorE3
    • B: BivectorE3

    Returns Geometric3

Static scalar

Static spinor

  • spinor(yz: number, zx: number, xy: number, α: number): Geometric3

Static vector

  • vector(x: number, y: number, z: number): Geometric3

Static wedge

Static zero

Legend

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

Generated using TypeDoc