Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Constant

extends

Vector

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Constant(value: Constant[], name?: undefined | string): Constant
  • new Constant(value: number[], name?: undefined | string): Constant
  • Creates a Vector.Constant object from a list of Scalar.Constant objects. One may optionally pass in a string by which this object may be identified by.

    Using the contructor directly for creating vector objects is not recommended.

    see

    Vector.constant

    Parameters

    • value: Constant[]

      The fixed value this should represent.

    • Optional name: undefined | string

      The name by which this is identified.

    Returns Constant

  • Creates a Vector.Constant object from a list of numbers. One may optionally pass in a string by which this object may be identified by.

    Using the contructor directly for creating vector objects is not recommended.

    see

    Vector.constant

    Parameters

    • value: number[]

      The fixed value this should represent.

    • Optional name: undefined | string

      The name by which this is identified.

    Returns Constant

Properties

name

name: string

The name by which this is identified. This is optional and defaults to the empty string "".

quantity

quantity: "vector" = "vector"

type

type: "constant" = "constant"

value

value: Constant[] = []

Accessors

X

  • get X(): (Anonymous function)
  • Returns the components of this vector. The index values start from 1 instead of the commonly used starting index 0.

    Returns (Anonymous function)

    The Scalar element at given index.

Methods

add

cross

dot

equals

  • equals(that: Constant): boolean
  • equals(that: Constant, tolerance: number): boolean
  • Checks for equality of two vector constants. The equality check for floating point numbers becomes problematic in the decimal system. The binary representation is finite and therefore even if two values are in fact equal they may not return true by using the == or === equality. To tackle this problem we use a tolerance value, if the difference of the two numerical values is less than that tolerance value then we can assume the values to be practically equal. Smaller tolerance values will result in more accurate checks. This function allows a default tolerance of 1e-14 for floating point numbers.

    Parameters

    • that: Constant

      The value to check equality with.

    Returns boolean

  • Checks for equality of two vector constants. The equality check for floating point numbers becomes problematic in the decimal system. The binary representation is finite and therefore even if two values are in fact equal they may not return true by using the == or === equality. To tackle this problem we use a tolerance value, if the difference of the two numerical values is less than that tolerance value then we can assume the values to be practically equal. Smaller tolerance values will result in more accurate checks.

    Parameters

    • that: Constant

      The value to check equality with.

    • tolerance: number

      The tolerance permitted for floating point numbers.

    Returns boolean

scale

sub

Static mag

Static unit

Generated using TypeDoc