Options
All
  • Public
  • Public/Protected
  • All
Menu

Class G3

The G3 class represents a multivector for a 3-dimensional vector space with a Euclidean metric.

The G3 class is immutable, making it easy to reason about values.

The G3 class supports units of measures.

The immutable nature of the G3 makes it less suitable for high performance graphics applications.

Hierarchy

  • G3

Implements

Index

Constructors

constructor

  • new G3(α: number, x: number, y: number, z: number, xy: number, yz: number, zx: number, β: number, uom?: Unit): G3
  • Parameters

    • α: number

      The scalar part of the multivector.

    • x: number

      The vector component of the multivector in the x-direction.

    • y: number

      The vector component of the multivector in the y-direction.

    • z: number

      The vector component of the multivector in the z-direction.

    • xy: number

      The bivector component of the multivector in the xy-plane.

    • yz: number

      The bivector component of the multivector in the yz-plane.

    • zx: number

      The bivector component of the multivector in the zx-plane.

    • β: number

      The pseudoscalar part of the multivector.

    • Optional uom: Unit

      The optional unit of measure.

    Returns G3

Properties

Private _coords

_coords: number[] = [0, 0, 0, 0, 0, 0, 0, 0]

The coordinate values are stored in a number array. This should be convenient and efficient for tensor calculations.

uom

uom: Unit

The optional unit of measure.

Static BASIS_LABELS

BASIS_LABELS: string[][] = BASIS_LABELS_G3_STANDARD

The current basis labels.

Static ampere

ampere: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.AMPERE)

Static candela

candela: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.CANDELA)

Static coulomb

coulomb: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.COULOMB)

Static e1

e1: G3 = new G3(0, 1, 0, 0, 0, 0, 0, 0)

Static e2

e2: G3 = new G3(0, 0, 1, 0, 0, 0, 0, 0)

Static e3

e3: G3 = new G3(0, 0, 0, 1, 0, 0, 0, 0)

Static kelvin

kelvin: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.KELVIN)

Static kilogram

kilogram: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.KILOGRAM)

Static meter

meter: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.METER)

Static mole

mole: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.MOLE)

Static one

one: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0)

Static second

second: G3 = new G3(1, 0, 0, 0, 0, 0, 0, 0, Unit.SECOND)

Static zero

zero: G3 = new G3(0, 0, 0, 0, 0, 0, 0, 0)

Accessors

a

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

b

  • get b(): number
  • set b(unused: number): void
  • The coordinate corresponding to the e1e2e3 basis trivector. The pseudoscalar coordinate of this multivector.

    Returns number

  • The coordinate corresponding to the e1e2e3 basis trivector. The pseudoscalar coordinate of this multivector.

    Parameters

    • unused: number

    Returns void

coords

  • get coords(): number[]

x

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

xy

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

y

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

yz

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

z

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

zx

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

Static BASIS_LABELS_GEOMETRIC

  • get BASIS_LABELS_GEOMETRIC(): string[][]

Static BASIS_LABELS_HAMILTON

  • get BASIS_LABELS_HAMILTON(): string[][]

Static BASIS_LABELS_STANDARD

  • get BASIS_LABELS_STANDARD(): string[][]

Static BASIS_LABELS_STANDARD_HTML

  • get BASIS_LABELS_STANDARD_HTML(): string[][]

Methods

__add__

__bang__

  • __bang__(): G3

__div__

  • __div__(rhs: any): G3

__eq__

  • __eq__(rhs: G3): boolean

__ge__

  • __ge__(rhs: G3): boolean

__gt__

  • __gt__(rhs: G3): boolean

__le__

  • __le__(rhs: G3): boolean

__lshift__

  • __lshift__(rhs: any): G3

__lt__

  • __lt__(rhs: G3): boolean

__mul__

  • __mul__(rhs: any): any

__ne__

  • __ne__(rhs: G3): boolean

__neg__

  • __neg__(): G3

__pos__

  • __pos__(): this

__radd__

__rdiv__

  • __rdiv__(lhs: any): G3

__rlshift__

  • __rlshift__(lhs: any): G3

__rmul__

  • __rmul__(lhs: any): any

__rrshift__

  • __rrshift__(lhs: any): G3

__rshift__

  • __rshift__(rhs: any): G3

__rsub__

__rvbar__

  • __rvbar__(lhs: any): G3

__rwedge__

  • __rwedge__(lhs: any): G3

__sub__

__tilde__

  • __tilde__(): G3

__vbar__

  • __vbar__(rhs: any): G3

__wedge__

  • __wedge__(rhs: any): G3

add

  • Computes the sum of this multivector and another considered to be the rhs of the binary addition, +, operator. This method does not change this multivector.

    Parameters

    Returns G3

addPseudo

addScalar

adj

  • adj(): G3

angle

  • angle(): G3

conj

  • conj(): G3

coordinate

  • coordinate(index: number): number

cos

  • cos(): G3

cosh

  • cosh(): G3

cross

  • cross(vector: G3): G3

cubicBezier

direction

  • direction(): G3

distanceTo

  • distanceTo(point: G3): number

div

divByScalar

  • divByScalar(α: number): G3

dual

  • dual(): G3

equals

  • equals(other: G3): boolean

exp

  • exp(): G3

ext

grade

  • grade(grade: number): G3

inv

  • inv(): G3

isOne

  • isOne(): boolean

isScalar

  • isScalar(): boolean

isZero

  • isZero(): boolean

lco

lerp

  • lerp(target: G3, α: number): G3

log

  • log(): G3

magnitude

  • magnitude(): G3

magnitudeSansUnits

  • magnitudeSansUnits(): number

mul

neg

  • neg(): G3

norm

  • norm(): G3

pow

  • pow(exponent: G3): G3

quad

  • quad(): G3

quadraticBezier

rco

reflect

rev

  • rev(): G3

rotate

scale

  • scale(α: number): G3

scp

sin

  • sin(): G3

sinh

  • sinh(): G3

slerp

  • slerp(target: G3, α: number): G3

sqrt

  • sqrt(): G3

squaredNorm

  • squaredNorm(): G3

squaredNormSansUnits

  • squaredNormSansUnits(): number

stress

sub

tan

  • tan(): G3

toExponential

  • toExponential(fractionDigits?: number): string

toFixed

  • toFixed(fractionDigits?: number): string

toPrecision

  • toPrecision(precision?: number): string

toString

  • toString(radix?: number): string

toStringCustom

  • toStringCustom(coordToString: (x: number) => string, labels: (string | string[])[]): string
  • Intentionally undocumented.

    Parameters

    • coordToString: (x: number) => string
        • (x: number): string
        • Parameters

          • x: number

          Returns string

    • labels: (string | string[])[]

    Returns string

Static copy

Static direction

Static fromCartesian

  • fromCartesian(α: number, x: number, y: number, z: number, xy: number, yz: number, zx: number, β: number, uom: Unit): G3

Static fromSpinor

Static fromVector

Static Private mutator

Static random

Static scalar

  • scalar(α: number, uom?: Unit): G3

Static vector

  • vector(x: number, y: number, z: number, uom?: Unit): G3