Options
All
  • Public
  • Public/Protected
  • All
Menu

multivariate_calculus

Index

Type aliases

Operator

The general operator type.

hyperComplex

hyperComplex: Array<-1 | 0 | 1>

Variables

Const DivisionByZero

DivisionByZero: DivisionByZero = <DivisionByZero><unknown> function(this: any, message: string) {return getErrorObject(this, message);}

Const IllegalNumberFormat

IllegalNumberFormat: IllegalNumberFormat = <IllegalNumberFormat><unknown>function(this: any, passed: string) {return getErrorObject(this, `Number format failed to parse: ${passed}`);}

Const IndeterminateForm

IndeterminateForm: IndeterminateForm = <IndeterminateForm><unknown> function(this: any, message: string) {return getErrorObject(this, message);}

Const InvalidIndex

InvalidIndex: InvalidIndex = <InvalidIndex><unknown> function(this: any, passed: number, start: number) {return getErrorObject(this, `Index ${passed} does not exist. Indexing starts from ${start}.`);}

Const Overwrite

Overwrite: Overwrite = <Overwrite><unknown> function(this: any, name: string) {return getErrorObject(this, `A constant with name ${name} has already been declared.`);}

Const UndefinedValue

UndefinedValue: UndefinedValue = <UndefinedValue><unknown>function(this: any, fnName: string, value: Numerical, extra?: string) {const trail = extra === undefined? "": ` ${extra}`;return getErrorObject(this, `Function ${fnName} is undefined for input ${value}.${trail}`);}

Const __

__: undefined = undefined

The double underscore.

Represents any unknown value. When passed in along with other known values this gets interpreted as an unknown or a Variable.

see

Vector.variable for a use case example.

Const e

e: Constant = Scalar.constant(Component.E)

The irrational Euler's number. The derivative of the exponential function to the base of this number gives the same exponential function.

Const pi

pi: Constant = Scalar.constant(Component.PI)

The circle constant pi. It is defined as the ratio of the circumference of a circle to its diameter.

Const tau

tau: Constant = Scalar.constant(Component.TWO.mul(Component.PI, {precision: 50, rounding: RoundingMode.UP}))

The circle constant tau. It is defined as the ratio of the circumference of a circle to its radius. It is twice the value of pi.

Functions

abs

  • abs(x: number): number
  • abs<T>(x: T, ...args: any[]): T
  • The absolute value function.

    Parameters

    • x: number

      A number.

    Returns number

  • The absolute value function. This function looks for the definition of the absolute value function in the Numerical object.

    throws

    If the sine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's sine function.

    Returns T

acos

  • acos(x: number): number
  • acos<T>(x: T, ...args: any[]): T
  • The inverse trigonometric cosine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The inverse trigonometric cosine function. This function looks for the definition of the inverse cosine function in the Numerical object.

    throws

    If the inverse cosine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's inverse cosine function.

    Returns T

acosh

  • acosh(x: number): number
  • acosh<T>(x: T, ...args: any[]): T
  • The inverse hyperbolic cosine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The inverse hyperbolic cosine function. This function looks for the definition of the inverse cosh function in the Numerical object.

    throws

    If the inverse hyperbolic cosine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's inverse hyperbolic cosine function.

    Returns T

alpha_beta

  • Helper function for inverse trig functions. Transforms the product of two into a sum (\( \alpha \)) and difference (\( \beta \)).

    \[ \alpha(x, y) = \sqrt{(x+1)^2 + y^2} \]

    \[ \beta(x, y) = \sqrt{(x-1)^2 + y^2} \]

    Parameters

    Returns Component[]

asin

  • asin(x: number): number
  • asin<T>(x: T, ...args: any[]): T
  • The inverse trigonometric sine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The inverse trigonometric sine function. This function looks for the definition of the inverse sine function in the Numerical object.

    throws

    If the inverse sine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's inverse sine function.

    Returns T

asinh

  • asinh(x: number): number
  • asinh<T>(x: T, ...args: any[]): T
  • The inverse hyperbolic sine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The inverse hyperbolic sine function. This function looks for the definition of the inverse sinh function in the Numerical object.

    throws

    If the inverse hyperbolic sine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's inverse hyperbolic sine function.

    Returns T

atan

  • atan(x: number): number
  • atan<T>(x: T, ...args: any[]): T
  • The inverse trigonometric tangent function.

    Parameters

    • x: number

      A number.

    Returns number

  • The inverse trigonometric tangent function. This function looks for the definition of the inverse tangent function in the Numerical object.

    throws

    If the inverse tangent function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's inverse tangent function.

    Returns T

atanh

  • atanh(x: number): number
  • atanh<T>(x: T, ...args: any[]): T
  • The inverse hyperbolic tangent function.

    Parameters

    • x: number

      A number.

    Returns number

  • The inverse hyperbolic tangent function. This function looks for the definition of the inverse tanh function in the Numerical object.

    throws

    If the inverse hyperbolic tangent function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's inverse hyperbolic tangent function.

    Returns T

ceil

  • ceil(x: number): number
  • ceil<T>(x: T, ...args: any[]): T
  • The smallest integer function.

    Parameters

    • x: number

      A number.

    Returns number

  • The smallest integer function. This function looks for the definition of the ceil function in the Numerical object.

    throws

    If the ceil function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's ceil function.

    Returns T

cos

  • cos(x: number): number
  • cos<T>(x: T, ...args: any[]): T
  • The trigonometric cosine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The trigonometric cosine function. This function looks for the definition of the cosine function in the Numerical object.

    throws

    If the cosine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's cosine function.

    Returns T

cosh

  • cosh(x: number): number
  • cosh<T>(x: T, ...args: any[]): T
  • The hyperbolic cosine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The hyperbolic cosine function. This function looks for the definition of the cosh function in the Numerical object.

    throws

    If the hyperbolic cosine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's hyperbolic cosine function.

    Returns T

exp

  • exp(x: number): number
  • exp<T>(x: T, ...args: any[]): T
  • The exponential function.

    Parameters

    • x: number

      A number.

    Returns number

  • The exponential function. This function looks for the definition of the exp function in the Numerical object.

    throws

    If the exponential function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's exponential function.

    Returns T

floor

  • floor(x: number): number
  • floor<T>(x: T, ...args: any[]): T
  • The greatest integer function.

    Parameters

    • x: number

      A number.

    Returns number

  • The greatest integer function. This function looks for the definition of the floor function in the Numerical object.

    throws

    If the floor function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's floor function.

    Returns T

isBinaryOperator

  • isBinaryOperator(s: string): s
  • Checks whether the passed string has been defined as a BinaryOperator.

    Parameters

    • s: string

    Returns s

isConstant

isEvaluable

  • isEvaluable(e: Token): e

isExpression

isUnaryOperator

  • isUnaryOperator(s: string): s
  • Checks whether the passed string has been defined as a UnaryOperator.

    Parameters

    • s: string

    Returns s

isValidMatrix

  • isValidMatrix(matrix2x2: number[][]): boolean
  • Parameters

    • matrix2x2: number[][]

    Returns boolean

isVariable

kronecker

  • kronecker(i: number, j: number): 0 | 1
  • kronecker(i: number[], j: number[]): 0 | 1
  • The Kronecker delta symbol for 2 dimensions.

    Parameters

    • i: number

      Index value.

    • j: number

      Index value.

    Returns 0 | 1

  • The generalised Kronecker delta symbol for any number of dimensions.

    Parameters

    • i: number[]

      Index values.

    • j: number[]

      Index values.

    Returns 0 | 1

levicivita

  • levicivita(values: number[]): 1 | 0 | -1
  • levicivita(...values: number[]): 1 | 0 | -1

Const ln

  • ln(x: number): number
  • ln<T>(x: T, ...args: any[]): T
  • The natural logarithm function (to the base \( e \)).

    Parameters

    • x: number

      A number.

    Returns number

  • The natural logarithm function (to the base \( e \)). This function looks for the definition of the ln function in the Numerical object.

    throws

    If the log function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's log function.

    Returns T

log

  • log(x: number): number
  • log<T>(x: T, ...args: any[]): T
  • The common logarithm function (to the base \( 10 \)).

    Parameters

    • x: number

      A number.

    Returns number

  • The common logarithm function (to the base \( 10 \)). This function looks for the definition of the log function in the Numerical object.

    throws

    If the common log function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's common log function.

    Returns T

mag

  • mag(x: number): number
  • mag<T>(x: T, ...args: any[]): T
  • The magnitude of a number. Returns the same value as abs.

    Parameters

    • x: number

      A number.

    Returns number

  • The magnitude value of its argument. This function looks for the definition of the magnitude function in the Numerical object.

    throws

    If magnitude is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T

      A Numerical object.

    • Rest ...args: any[]

      Any additional parameters required by the object's magnitude function.

    Returns T

neg

  • neg(x: number): number
  • neg<T>(x: T, ...args: any[]): T
  • The negative value of its argument.

    Parameters

    • x: number

      A number.

    Returns number

  • The negative value of its argument. This function looks for the definition of the negation function in the Numerical object.

    throws

    If negation is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's negation function.

    Returns T

parseNum

  • parseNum(s: string): string[]
  • Takes a string and parses into the format expected by the BigNum class. If the string is not of a valid format then it throws error.

    Parameters

    • s: string

      String representation of the number.

    Returns string[]

    An array where the first element is the integer part and the second is the decimal part.

print

  • print(...obj: any[]): void
  • Prints the string representation of an object to the default console.

    Parameters

    • Rest ...obj: any[]

      Object to print.

    Returns void

roundTo

  • roundTo(num: bigint, power: number, mode: RoundingMode): bigint
  • Rounds a number off, accurate to the given power of 10. The rounding algorithms are heavily influenced by the Java implementation of the same.

    Parameters

    • num: bigint

      The number to round off.

    • power: number

      The power of 10 to round the number to.

    • mode: RoundingMode

      Flag for which rounding algorithm to use.

    Returns bigint

sin

  • sin(x: number): number
  • sin<T>(x: T, ...args: any[]): T
  • The trigonometric sine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The trigonometric sine function. This function looks for the definition of the sine function in the Numerical object.

    throws

    If the sine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's sine function.

    Returns T

sinh

  • sinh(x: number): number
  • sinh<T>(x: T, ...args: any[]): T
  • The hyperbolic sine function.

    Parameters

    • x: number

      A number.

    Returns number

  • The hyperbolic sine function. This function looks for the definition of the sinh function in the Numerical object.

    throws

    If the hyperbolic sine function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's hyperbolic sine function.

    Returns T

tan

  • tan(x: number): number
  • tan<T>(x: T, ...args: any[]): T
  • The trigonometric tangent function.

    Parameters

    • x: number

      A number.

    Returns number

  • The trigonometric tangent function. This function looks for the definition of the tangent function in the Numerical object.

    throws

    If the tangent function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's tangent function.

    Returns T

tanh

  • tanh(x: number): number
  • tanh<T>(x: T, ...args: any[]): T
  • The hyperbolic tangent function.

    Parameters

    • x: number

      A number.

    Returns number

  • The hyperbolic tangent function. This function looks for the definition of the tanh function in the Numerical object.

    throws

    If the hyperbolic tangent function is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T
    • Rest ...args: any[]

      Any additional parameters required by the object's hyperbolic tangent function.

    Returns T

unit

  • unit(x: number): -1 | 0 | 1
  • unit<T>(x: T, ...args: any[]): T
  • The signed unit of a number. Mathematically it is equivalent to

    \[ \operatorname{unit}(x) = \begin{cases} 0 & x = 0 \ \frac{x}{\lvert x \rvert} \end{cases} \]

    Parameters

    • x: number

      A number.

    Returns -1 | 0 | 1

  • The unit value of its argument. This function looks for the definition of the unit function in the Numerical object. This is defined and makes sense for vectors. For vector arguments, the function returns the unit vector in the same direction as the argument vector.

    throws

    If unit is not defined for the argument object type.

    Type parameters

    Parameters

    • x: T

      A Numerical object.

    • Rest ...args: any[]

      Any additional parameters required by the object's unit function.

    Returns T

Object literals

Const mathenv

mathenv: object

Stores information about the Math environment.

coordinate_system

coordinate_system: "cartesian" = "cartesian"

mode

mode: object = MathContext.DEFAULT_CONTEXT

Type declaration

  • precision: number

    The number of decimal places a BigNum object should store. This does not represent the number of significant digits in the number unlike the JAVA implementation of the same concept.

  • rounding: RoundingMode

    The rounding algorithm that should be used for a particular numerical operation. Care must be taken as to when the UNNECESSARY mode is used, it will throw an exception if an exact representation of the result is not found.

Generated using TypeDoc