Skip to content
Bruno degli Uberti edited this page Apr 28, 2023 · 5 revisions

math.js will also be available at https://github.com/aantthony/javascript-cas when and if it becomes large.

Structure

  • Mathematical expressions are represented as an Array, where the elements are the arguments of the n-ary operator, and the operator is defined by the "type" property of the array. The elements are also mathematical expressions. So it is recursively defined until a string, or number is reached.

Operators

  • summation is an n-ary operator. Inverse: minus each
  • product is an n-ary operator.
  • fraction is a binary operator.
  • power is a binary operator.
  • tetration is an n-ary operator. not necessary. Inverse: ?
  • function is an n-ary operator. First element: string of function name. Other elements are arguments. This could be for example: log, sin, cos, W, or the "fact"orial function. Unless factorial should be separate.
  • Minus (no eqtype) Expressed as multiplication by negative 1, or maybe: changing the sign of the first number in the array.

Methods

  • .simplify()
  • .differentiate()
  • .integrate()
  • .eval()

Solving

Inverse

Method

  • alert(p("x+3*2").inverse())
Clone this wiki locally