Solve Math expressions, create equations, define operators and constants
Go to file
Mahdi Dibaiee 647d827e5d ow 👊
2015-04-20 15:19:53 +04:30
dist browser versions 2015-04-20 15:15:56 +04:30
lib small change for better reading 2015-04-20 15:18:50 +04:30
tests small fix, added tests, readme 2015-04-20 14:25:41 +04:30
.eslintrc initial commit 2015-04-20 13:58:11 +04:30
.gitignore initial commit 2015-04-20 13:58:11 +04:30
equation.js browser versions 2015-04-20 15:15:56 +04:30
equation.min.js browser versions 2015-04-20 15:15:56 +04:30
Gruntfile.js browser versions 2015-04-20 15:15:56 +04:30
package.json browser versions 2015-04-20 15:15:56 +04:30
README.md ow 👊 2015-04-20 15:19:53 +04:30

Equation

Solve math expressions or create equations for repeated and complex Math tasks. To use in browser, download equation.min.js.

// solve
console.log(Equation.solve('4 * lg(4) ^ 3')); // 32

// equation
let sphereArea = Equation.equation('4 * PI * r^2');

console.log(sphereArea(5)); // 314.1592653589793

API

####solve(expression: String) Takes a math expression and evaluates it, returning the result.

###equation(expression: String) Takes a math expression containing variables, returning a function which replaces the variables with given arguments, and solves the expression.

TODO

  • Equation solver
  • More tests