Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Scalar

Base class to works with scalar quantities.

abstract
namespace

Hierarchy

Implements

Index

Properties

Abstract classRef

classRef: any

Returns the class of which this object is an instance of.

Abstract neg

neg: Scalar

quantity

quantity: "scalar" = "scalar"

Abstract type

type: "constant" | "variable" | "expression"

Static ZERO

ZERO: Constant = Scalar.constant(0)

Methods

Abstract add

  • Adds two Scalars together. If this and that are both constants then numerically adds the two and returns a new Scalar.Constant object otherwise creates an Expression out of them and returns the same.

    Parameters

    • that: Scalar

      The scalar to add this with.

    Returns Scalar

    The result of algebraic addition.

Abstract div

  • Divides this scalar by that. If this and that are both constants then numerically divides the two and returns a new Scalar.Constant object otherwise creates an Expression out of them and returns the same.

    Parameters

    • that: Scalar

      The scalar to divide this by.

    Returns Scalar

    The result of algebraic division.

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"

Abstract mul

  • Multiplies two Scalars together. If this and that are both constants then numerically multiplies the two and returns a new Scalar.Constant object otherwise creates an Expression out of them and returns the same.

    Parameters

    • that: Scalar

      The scalar to multiply this with.

    Returns Scalar

    The result of algebraic multiplication.

Abstract pow

  • Raises this scalar to the power of that. If this and that are both constants then numerically evaluates the exponentiation and returns a new Scalar.Constant object otherwise creates an Expression out of them and returns the same.

    Parameters

    • that: Scalar

      The scalar to divide this by.

    Returns Scalar

    The result of algebraic division.

Abstract sub

  • Subtracts that from this. If this and that are both constants then numerically subtracts one from the other and returns a new Scalar.Constant object otherwise creates an Expression out of them and returns the same.

    Parameters

    • that: Scalar

      The scalar to subtract from this.

    Returns Scalar

    The result of algebraic subtraction.

Static abs

Static acos

Static acosh

Static asin

Static asinh

Static atan

Static atanh

Static ceil

Static constant

  • Creates a new Scalar.Constant object from a number.

    This is the recommended way of creating Scalar.Constant objects instead of using the constructor.

    Parameters

    • value: number

      The fixed value the Scalar.Constant is supposed to represent.

    Returns Constant

  • Defines a named Scalar.Constant object from a number.

    This is the recommended way of creating named Scalar.Constant objects instead of using the constructor.

    throws

    Throws an error if a Scalar.Constant with the same name has been defined previously.

    Parameters

    • value: number

      The fixed value the Scalar.Constant is supposed to represent.

    • name: string

      The string with which this object is identified.

    Returns Constant

  • Creates a new Scalar.Constant object from an array of numbers. The numbers are interpreted as the real and imaginary components of a hyper-complex number.

    This is the recommended way of creating Scalar.Constant objects instead of using the constructor.

    Parameters

    • value: number[]

      The fixed value the Scalar.Constant is supposed to represent.

    Returns Constant

  • Defines a named Scalar.Constant object from an array of numbers. The numbers are interpreted as the real and imaginary components of a hyper-complex number.

    This is the recommended way of creating named Scalar.Constant objects instead of using the constructor.

    throws

    Throws an error if a Scalar.Constant with the same name has been defined previously.

    Parameters

    • value: number[]

      The fixed value the Scalar.Constant is supposed to represent.

    • name: string

      The string with which this object is identified.

    Returns Constant

  • Creates a new Scalar.Constant object from an array of strings. The numbers are interpreted as the real and imaginary components of a hyper-complex number.

    This is the recommended way of creating Scalar.Constant objects instead of using the constructor.

    Parameters

    • value: string[]

      The fixed value the Scalar.Constant is supposed to represent.

    Returns Constant

  • Defines a named Scalar.Constant object from an array of strings. The numbers are interpreted as the real and imaginary components of a hyper-complex number.

    This is the recommended way of creating named Scalar.Constant objects instead of using the constructor.

    throws

    Throws an error if a Scalar.Constant with the same name has been defined previously.

    Parameters

    • value: string[]

      The fixed value the Scalar.Constant is supposed to represent.

    • name: string

      The string with which this object is identified.

    Returns Constant

  • Creates a new Scalar.Constant object from a Component object.

    This is the recommended way of creating Scalar.Constant objects instead of using the constructor.

    Parameters

    Returns Constant

  • Defines a named Scalar.Constant object from a Component object.

    This is the recommended way of creating named Scalar.Constant objects instead of using the constructor.

    throws

    Throws an error if a Scalar.Constant with the same name has been defined previously.

    Parameters

    • value: Component

      The fixed value the Scalar.Constant is supposed to represent.

    • name: string

      The string with which this object is identified.

    Returns Constant

  • Creates a new Scalar.Constant object from a BigNum object.

    This is the recommended way of creating Scalar.Constant objects instead of using the constructor.

    Parameters

    Returns Constant

  • Defines a named Scalar.Constant object from a BigNum object.

    This is the recommended way of creating named Scalar.Constant objects instead of using the constructor.

    throws

    Throws an error if a Scalar.Constant with the same name has been defined previously.

    Parameters

    • value: BigNum

      The fixed value the Scalar.Constant is supposed to represent.

    • name: string

      The string with which this object is identified.

    Returns Constant

  • Returns a previously declared named Scalar.Constant object.

    Parameters

    • name: string

      The name of the named Scalar.Constant object to be retrieved.

    Returns Constant

Static cos

Static cosh

Static exp

Static floor

Static ln

Static log

Static sin

Static sinh

Static tan

Static tanh

Static variable

  • Creates a new Scalar.Variable object if it has not been created before. Otherwise just returns the previously created object.

    Parameters

    • name: string

    Returns Variable

Generated using TypeDoc