Functions

Class ExprFunction

Extends ExprElement

constructor (fn: string, args: Array<ExprElement>): ExprFunction

Name Type Default Description
fn string    
args Array<ExprElement>  

readonly Property .args

Default value: ...

readonly Property .fn : string

Accessor .functions

Accessor .simplified : this

Accessor .unknowns

Returns a list of all variables used in the expression (excluding defined constants).

Accessor .variables

Method .collapse (): ExprFunction|ExprElement

Method .evaluate (vars: VarMap): number

Name Type Default Description
vars VarMap  

Method .interval (vars: VarMap): Interval

Name Type Default Description
vars VarMap  

Method .recursiveSubstitute (vars: ExprMap): ExprElement

Recursively substitutes a new expression for a variable. NOTE: This function does not test for cyclical dependencies, which could lead to an infinite loop. You have to manually validate expressions first!

Name Type Default Description
vars ExprMap    

Method .substitute (vars: ExprMap): ExprFunction

Name Type Default Description
vars ExprMap  

Method .toMathML (custom: MathMLMap): string

Name Type Default Description
custom MathMLMap  

Method .toString (): string

Method .toVoice (custom: MathMLMap): string

Name Type Default Description
custom MathMLMap  

Class ExprTerm

Extends ExprElement

constructor (items: Array<ExprElement>): ExprTerm

Name Type Default Description
items Array<ExprElement>    

readonly Property .items

Accessor .functions

Accessor .simplified : ExprElement

Accessor .unknowns

Returns a list of all variables used in the expression (excluding defined constants).

Accessor .variables

Method .collapse (): ExprElement

Method .evaluate (vars: VarMap): number

Name Type Default Description
vars VarMap  

Method .interval (vars: VarMap): Interval

Name Type Default Description
vars VarMap  

Method .recursiveSubstitute (vars: ExprMap): ExprElement

Recursively substitutes a new expression for a variable. NOTE: This function does not test for cyclical dependencies, which could lead to an infinite loop. You have to manually validate expressions first!

Name Type Default Description
vars ExprMap    

Method .substitute (vars: ExprMap): ExprElement

Name Type Default Description
vars ExprMap  

Method .toMathML (custom: MathMLMap): string

Name Type Default Description
custom MathMLMap  

Method .toString (): string

Method .toVoice (custom: MathMLMap): string

Name Type Default Description
custom MathMLMap  

Copyright © 2024 Mathigon.org