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

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