Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Constant

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

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

  • 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 constructor directly for creating vector objects is not recommended.

    see

    Vector.constant

    Parameters

    • value: BigNum[]

      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"

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

  • Creates and returns a Vector.Expression for the cross product of two Vector objects. The type of this does not matter because cross multiplying a variable vector to another vector always results in an expression.

    Parameters

    Returns void

    Expression for vector product of this and that.

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

  • Computes the magnitude of a given vector. If A vector is a constant vector then numerically calculates the magnitude otherwise creates a scalar Expression and returns the same.

    Parameters

    Returns void

    The Scalar magnitude of the given Vector.

Static unit

Generated using TypeDoc