Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Constant

Represents constant vectors. That is, all the vector components are Scalar.Constants. All the components are interpreted as in the Cartesian system.

Hierarchy

Implements

Index

Constructors

constructor

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

Properties

classRef

classRef: Constant = Vector.Constant

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.

dimension

  • get dimension(): number

neg

  • Evaluates and returns the negated value of a vector constant. A negative vector \( - \overrightarrow{A} \) is defined such that

    \[ \overrightarrow{A} + \left( - \overrightarrow{A} \right) = \overrightarrow{0} \].

    Component wise, if \( \overrightarrow{A} = a_i \hat{e_i} \), it can be expressed as

    \[ - \overrightarrow{A} = -a_i \hat{e_i} \].

    Returns Constant

Methods

add

cross

dot

equals

  • 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

    Returns boolean

getDefinition

  • getDefinition(methodName: string): "instance" | "static" | "undefined"
  • Checks whether a method exists on the object or as a static member of the class.

    Parameters

    • methodName: string

      Name of the method.

    Returns "instance" | "static" | "undefined"

scale

sub

Static mag

Static unit

Generated using TypeDoc