Link Search Menu Expand Document

Elements

elements.ts#L26

Class ExprElement

Maths Expression

constructor (): ExprElement

Accessor .functions

Returns a list of all functions called by the expression.

Accessor .simplified : ExprElement

Returns the simplest mathematically equivalent expression.

Accessor .variables

Returns a list of all variables used in the expression.

Method .collapse (): ExprElement

Collapses all terms into functions.

Method .evaluate (_vars: VarMap): number

Evaluates an expression using a given map of variables and functions.

Name Type Default Description
_vars VarMap  

Method .substitute (_vars: ExprMap): ExprElement

Substitutes a new expression for a variable.

Name Type Default Description
_vars ExprMap  

Method .toMathML (_custom: MathMLMap): string

Converts the expression to a MathML string.

Name Type Default Description
_custom MathMLMap  

Method .toString (): string

Converts the expression to a plain text string.

Method .toVoice (_custom: MathMLMap): string

Converts the expression to a MathML string.

Name Type Default Description
_custom MathMLMap  
elements.ts#L99

Class ExprIdentifier

Extends ExprElement

readonly Property .i : string

Method .evaluate (vars: VarMap): number

Name Type Default Description
vars VarMap  

Method .substitute (vars: ExprMap): ExprElement

Name Type Default Description
vars ExprMap  

Method .toMathML (): string

Method .toString (): string

Method .toVoice (): string

elements.ts#L76

Class ExprNumber

Extends ExprElement

readonly Property .n : number

Method .evaluate (): number

Method .toMathML (): string

Method .toString (): string

Method .toVoice (): string

elements.ts#L171

Class ExprOperator

Extends ExprElement

readonly Property .o : string

Method .toMathML (): string

Method .toString (): string

Method .toVoice (): string

elements.ts#L160

Class ExprSpace

Extends ExprElement

Method .toMathML (): string

Method .toString (): string

elements.ts#L136

Class ExprString

Extends ExprElement

readonly Property .s : string

Method .evaluate (vars: VarMap): number

Name Type Default Description
vars VarMap  

Method .toMathML (): string

Method .toString (): string

Method .toVoice (): string

elements.ts#L12

Interface MathMLArgument

Property .toString

Property .val : ExprElement

elements.ts#L17

Type alias CustomFunction

elements.ts#L19

Type alias ExprMap : Obj<ExprElement>

elements.ts#L20

Type alias MathMLMap : Obj<(args: Array<MathMLArgument>): string>

elements.ts#L18

Type alias VarMap : Obj<number|CustomFunction>


Copyright © 2021 Mathigon.org