Class Geometric2

A mutable and lockable multivector in 2D with a Euclidean metric and optional unit of measure.

Hierarchy

  • AbstractMeasure
    • Geometric2

Constructors

  • Constructs a mutable instance of Geometric2 from coordinates and an optional unit of measure.

    Parameters

    • Optional coords: [a: number, x: number, y: number, b: number]

      The 4 coordinates are in the order [a, x, y, b].

    • Optional uom: Unit

      The optional unit of measure.

    Returns Geometric2

Properties

Constructs a basis vector corresponding to the β coordinate. The returned multivector is locked.

ampere: Geometric2

SI base unit of electric current. The ampere is that constant current which, if maintained in two straight parallel conductors of infinite length, of negligible circular cross-section, and placed 1 meter apart in vacuum, would produce between these conductors a force equal to 2 x 10-7 newton per meter of length.

candela: Geometric2

SI base unit of luminous intensity. The candela is the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540 x 1012 hertz and that has a radiant intensity in that direction of 1 / 683 watt per steradian.

coulomb: Geometric2

SI derived unit of electric charge, quantity of electricity.

Constructs a basis vector corresponding to the x coordinate. The returned multivector is locked.

Constructs a basis vector corresponding to the y coordinate. The returned multivector is locked.

joule: Geometric2

SI derived unit of energy, work, quantity of heat.

kelvin: Geometric2

SI base unit of thermodynamic temperature. The kelvin, unit of thermodynamic temperature, is the fraction 1 / 273.16 of the thermodynamic temperature of the triple point of water.

kilogram: Geometric2

SI base unit of mass. The kilogram is the unit of mass; it is equal to the mass of the international prototype of the kilogram.

meter: Geometric2

SI base unit of length. The meter is the length of the path travelled by light in vacuum during a time interval of 1 / 299 792 458 of a second.

SI base unit of amount of substance.

  1. The mole is the amount of substance of a system which contains as many elementary entities as there are atoms in 0.012 kilogram of carbon 12; its symbol is "mol."

  2. When the mole is used, the elementary entities must be specified and may be atoms, molecules, ions, electrons, other particles, or specified groups of such particles.

newton: Geometric2

SI derived unit of force.

Constructs a Geometric2 representing the number one. The identity element for multiplication, 1. The returned multivector is locked.

second: Geometric2

SI base unit of time. The second is the duration of 9 192 631 770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium 133 atom.

Constructs a Geometric2 representing the number zero. The identity element for addition, 0. The returned multivector is locked.

Accessors

  • get a(): number
  • The scalar part of this multivector.

    Returns number

  • set a(a): void
  • Parameters

    • a: number

    Returns void

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

    Returns number

  • set b(b): void
  • Parameters

    • b: number

    Returns void

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

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

    Returns number

  • get uom(): Unit
  • Returns Unit

  • set uom(uom): void
  • Parameters

    Returns void

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

    Returns number

  • set x(x): void
  • Parameters

    • x: number

    Returns void

  • get xy(): number
  • Returns number

  • set xy(xy): void
  • Parameters

    • xy: number

    Returns void

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

    Returns number

  • set y(y): void
  • Parameters

    • y: number

    Returns void

Methods

  • Returns Geometric2

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

    Parameters

    • M: GeometricE2

      The multivector to be added to this multivector.

    • Optional α: number

      An optional scale factor that multiplies the multivector argument.

    Returns Geometric2

    this + M * α

  • Parameters

    • β: number
    • Optional uom: Unit

    Returns Geometric2

  • Adds a multiple of a scalar to this multivector.

    Parameters

    • a: number

      The scalar value to be added to this multivector.

    • Optional uom: Unit

      The optional unit of measure.

    • Optional α: number

      The fraction of (a * uom) to be added. Default is 1.

    Returns Geometric2

    this + (a * uom) * α

  • Parameters

    • v: VectorE2

      The vector to be added to this multivector.

    • Optional α: number

      An optional scale factor that multiplies the vector argument.

    Returns Geometric2

    this + v * α

  • Returns Geometric2

    copy(this)

  • Returns Geometric2

  • this ⟼ copy(M)

    Parameters

    • M: GeometricE2

      The multivector to be copied.

    Returns this

  • this ⟼ copy(B)

    Parameters

    • B: BivectorE2

      The bivector to be copied.

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

    • uom: Unit

      The unit of measure.

    Returns this

  • Parameters

    • spinor: SpinorE2

    Returns Geometric2

  • Copies the vector argument value into this multivector. The non-vector components are set to zero.

    Parameters

    • vector: VectorE2

      The vector to be copied.

    Returns this

  • Returns Geometric2

    this / magnitude(this)

  • Parameters

    • rhs: GeometricE2

      The multivector dividend.

    Returns Geometric2

    this / m;

  • Parameters

    • α: number

    Returns Geometric2

  • Parameters

    • β: number
    • Optional uom: Unit

    Returns Geometric2

  • this ⟼ this / (α * uom)

    Parameters

    • a: number

      The scalar dividend.

    • uom: Unit

      The unit of measure.

    Returns Geometric2

  • Parameters

    • v: VectorE2

    Returns Geometric2

  • Returns Geometric2

  • Parameters

    • other: unknown

    Returns boolean

  • Parameters

    • m: GeometricE2

    Returns Geometric2

    this ^ m

  • Parameters

    • n: number

    Returns Geometric2

  • Computes the right inverse of this multivector. inv(X) satisfies X * inv(X) = 1.

    Returns Geometric2

    inverse(this)

  • Returns boolean

  • Determines whether this multivector is locked. If the multivector is in the unlocked state then it is mutable. If the multivector is in the locked state then it is immutable.

    Returns boolean

  • Returns boolean

  • Returns boolean

  • Returns boolean

  • Returns boolean

  • Returns boolean

  • Determines whether this multivector is exactly 0 (zero).

    Returns boolean

  • Parameters

    • rhs: GeometricE2

    Returns Geometric2

  • Locks this multivector (preventing any further mutation), and returns a token that may be used to unlock it.

    Returns number

  • Computes the square root of the squared norm.

    Returns Geometric2

  • Parameters

    • rhs: GeometricE2

    Returns Geometric2

    this * m

  • Parameters

    • B: BivectorE2

    Returns Geometric2

  • Parameters

    • α: number

    Returns Geometric2

    this * α

  • Parameters

    Returns Geometric2

    this * (α * uom)

  • Parameters

    • v: VectorE2

    Returns Geometric2

  • Returns Geometric2

    this * -1

  • Returns Geometric2

  • Returns this

  • Parameters

    • m: GeometricE2

    Returns Geometric2

  • If this is mutable, then sets this multivector to its reflection in the plane orthogonal to vector n. The result is mutable. If this is immutable (locked), a copy of this is made, which is then reflected. The result is immutable (locked).

    i.e. The result is mutable (unlocked) iff this is mutable (unlocked).

    Mathematically,

    this ⟼ - n * this * n

    Geometrically,

    Reflects this multivector in the plane orthogonal to the unit vector, n. This implementation does assume that n is a vector, but does not assume that it is normalized to unity.

    If n is not a unit vector then the result is scaled by n squared. The scalar component gets an extra minus sign. The pseudoscalar component does not change sign. The units of measure are carried through but in most cases n SHOULD be dimensionless.

    Parameters

    • n: Readonly<VectorE2>

      The unit vector that defines the reflection plane.

    Returns Geometric2

  • reverse has a ++-- structure on the grades. The scalar component, a, will not change. The vector components, x and y, will not change. The bivector component, b, will change sign.

    Returns Geometric2

  • (α + βI)(a + x.e1 + y.e2 + b.I)(α - β.I)

    Parameters

    • spinor: SpinorE2

      the spinor that rotates this multivector.

    Returns Geometric2

    R * this * reverse(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.

    Parameters

    • a: VectorE2

      The starting vector

    • b: VectorE2

      The ending vector

    Returns Geometric2

    The rotor representing a rotation from a to b.

  • Parameters

    • es: VectorE2[]
    • fs: VectorE2[]

    Returns Geometric2

  • Sets this multivector to a rotor that rotates through angle θ in the oriented plane defined by B.

    Parameters

    • B: BivectorE2

      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 Geometric2

  • R = sqrt(|b|/|a|) * (|b||a| + b * a) / sqrt(2 * |b||a|(|b||a| + b << a))

    The result is depends on the magnitudes of a and b.

    Parameters

    • a: VectorE2
    • b: VectorE2

    Returns Geometric2

  • Parameters

    • α: number

    Returns Geometric2

  • Parameters

    • m: GeometricE2

    Returns Geometric2

    this | m

  • Returns Geometric2

  • Returns Geometric2

  • Parameters

    • M: GeometricE2
    • Optional α: number

    Returns Geometric2

    this - M * α

  • Subtracts a multiple of a scalar from this multivector.

    Parameters

    • a: number

      The scalar value to be subtracted from this multivector.

    • Optional uom: Unit

      The optional unit of measure.

    • Optional α: number

      The fraction of (a * uom) to be subtracted. Default is 1.

    Returns Geometric2

    this - (a * uom) * α

  • Parameters

    • v: VectorE2

      The vector to subtract from this multivector.

    • Optional α: number

      The multiplier for the amount of the vector to subtract.

    Returns Geometric2

    this - v * α

  • Returns a string representing the number in exponential notation.

    Parameters

    • Optional fractionDigits: number

    Returns string

  • Returns a string representing the number in fixed-point notation.

    Parameters

    • Optional fractionDigits: number

    Returns string

  • Parameters

    • Optional radix: number

    Returns string

  • Parameters

    • Optional precision: number

    Returns string

  • Returns a string representation of the number.

    Parameters

    • Optional radix: number

    Returns string

  • Unlocks this multivector (allowing mutation), using a token that was obtained from a preceding lock method call.

    Parameters

    • token: number

    Returns this

  • Sets this Geometric2 to have the specified cartesian coordinates and unit of measure.

    this.a ⟼ 0, this.x ⟼ x, this.y ⟼ y, this.b ⟼ 0, this.uom ⟼ uom

    Parameters

    • x: number

      The cartesian x coordinate corresponding to the e1 basis vector.

    • y: number

      The cartesian y coordinate corresponding to the e2 basis vector.

    • Optional uom: Unit

      The optional unit of measure.

    Returns Geometric2

    this Geometric2.

    Throws

    An Error if this Geometric2 is not mutable.

  • this ⟼ a * b

    Sets this Geometric2 to the geometric product a * b of the vector arguments.

    Parameters

    • a: VectorE2
    • b: VectorE2

    Returns this

  • Parameters

    • mv: GeometricE2

    Returns void

  • Parameters

    • B: BivectorE2

    Returns void

  • Parameters

    • v: VectorE2

    Returns void

  • Sets this multivector to the identity element for addition, 0.

    Returns this

  • Creates a grade 2 (bivector) multivector from the specified cartesian coordinates. The bivector returned is in the unlocked (mutable) state.

    Parameters

    • b: number

      The coordinate corresponding to the e1e2 basis bivector.

    • Optional uom: Unit

      The optional unit of measure. Equivalent to 1 if omitted.

    Returns Geometric2

  • Parameters

    • mv: GeometricE2

    Returns Geometric2

  • Parameters

    • B: BivectorE2

    Returns Geometric2

  • Parameters

    • alpha: Scalar

    Returns Geometric2

  • Parameters

    • R: SpinorE2

    Returns Geometric2

  • Parameters

    • v: VectorE2

    Returns Geometric2

  • Parameters

    • a: VectorE2
    • b: VectorE2

    Returns Geometric2

  • Parameters

    • a: VectorE2
    • b: VectorE2

    Returns Geometric2

  • Creates a grade 0 (scalar) multivector with value alpha * uom. The scalar returned is in the unlocked (mutable) state.

    Parameters

    • a: number

      The scaling factor for the unit of measure.

    • Optional uom: Unit

      The optional unit of measure. Equivalent to 1 if omitted.

    Returns Geometric2

  • Creates a spinor valued multivector from the specified cartesian coordinates. The spinor returned is in the unlocked (mutable) state.

    Parameters

    • a: number

      The scalar coordinate.

    • b: number

      The pseudoscalar coordinate.

    • Optional uom: Unit

      The optional unit of measure. Equivalent to 1 if omitted.

    Returns Geometric2

  • Creates a grade 1 (vector) multivector from the specified cartesian coordinates.

    Parameters

    • x: number

      The coordinate corresponding to the e1 basis vector.

    • y: number

      The coordinate corresponding to the e2 basis vector.

    • Optional uom: Unit

      The optional unit of measure. Equivalent to 1 if omitted.

    Returns Geometric2

Generated using TypeDoc