Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Constant

Represents a constant scalar quantity with a fixed value.

Hierarchy

Implements

Index

Constructors

constructor

  • Creates a Scalar.Constant object from number. 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

    Scalar.constant

    Parameters

    • value: BigNum

      The fixed value this should represent.

    • Default value name: string = ""

      The name by which this is identified.

    Returns Constant

Properties

classRef

classRef: Constant = Scalar.Constant

name

name: string

The name by which this is identified.

quantity

quantity: "scalar" = "scalar"

type

type: "constant" = "constant"

value

value: BigNum

The fixed value this should represent.

Accessors

neg

Methods

add

div

equals

  • Checks for equality of two scalar 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 scalar 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"

mul

pow

  • Creates and returns a Scalar.Expression for exponentiation of two Scalar objects. The type of this does not matter because exponentiating a scalar by a variable scalar always results in an expression.

    Parameters

    Returns void

    Expression for exponentiating this by that.

sub

Static abs

Static acos

Static acosh

Static asin

Static asinh

Static atan

Static atanh

Static ceil

Static cos

Static cosh

Static exp

Static floor

Static ln

Static log

Static sin

Static sinh

Static tan

Static tanh

Generated using TypeDoc