API Docs for: 1.0.0
Show:

MathFunction.Quotient Class

Quotient of values.

Constructor

MathFunction.Quotient

(
  • n
  • d
)

Parameters:

Methods

_printArg

(
  • index
)
String protected

Print an argument, with parentheses if necessary.

Parameters:

Returns:

String:

the string representation of the argument

evaluate

(
  • var_list
)

Parameters:

  • var_list Object

    map of variable names to values or MathFunctions

Returns:

the value of the function

evaluateArgs

(
  • var_list
)
protected

Parameters:

  • var_list Object

    map of variable names to values or MathFunctions

Returns:

list of argument values, from calling evaluate()

getArg

() MathFunction

Returns:

MathFunction:

requested argument, or undefined

getArgCount

() Int

Returns:

Int:

number of arguments

getArgs

() Array

Returns:

Array:

array of arguments

getMaxArgCount

() Int

By default, we assume the number of arguments is fixed. Derived classes can override.

Returns:

Int:

maximum number of arguments

getParent

() MathFunction

Returns:

MathFunction:

parent function or null

handleKeyPress

(
  • canvas
  • code
  • c
)

Overridden by Input.

Parameters:

  • canvas MathCanvas
  • code Int

    character code

  • c String

    character

Returns:

true if function changed

insertArgAfter

(
  • f
  • after
)

Parameters:

insertArgBefore

(
  • f
  • before
)

Parameters:

layout

(
  • context
  • top_left
  • font_size
  • rect_list
)
Int

Parameters:

  • context Object

    the drawing context

  • top_left Point

    x,y coordinates of the top left of the bounding box

  • font_size Float

    percentage of the base font size

  • rect_list RectList

    layout information

Returns:

Int:

index of this items info in rect_list

parenthesizeForPrint

(
  • f
)
Boolean protected

Parameters:

Returns:

Boolean:

true if f needs to parenthesize us

parenthesizeForRender

(
  • f
)
Boolean protected

Parameters:

Returns:

Boolean:

true if f needs to parenthesize us

render

(
  • context
  • rect_list
)

Parameters:

  • context Object

    the drawing context

  • rect_list RectList

    layout information

replaceArg

(
  • origArg
  • newArg
)

If origArg is an argument, replaces origArg with newArg.

Parameters:

toString

()

Returns:

text representation of the function