Equation.js/lib/README.md

29 lines
742 B
Markdown
Raw Normal View History

2015-04-20 09:55:41 +00:00
Equation
========
Solve math expressions or create equations for repeated and complex Math tasks.
2015-04-20 10:47:08 +00:00
To use in browser, download [`equation.min.js`](https://raw.githubusercontent.com/mdibaiee/Equation.js/master/equation.min.js).
2015-04-20 09:55:41 +00:00
```javascript
// solve
2015-04-20 10:02:34 +00:00
console.log(Equation.solve('4 * lg4 ^ 3')); // 32
2015-04-20 09:55:41 +00:00
2015-04-20 10:02:34 +00:00
// equation
2015-04-20 09:55:41 +00:00
let sphereArea = Equation.equation('4 * PI * r^2');
console.log(sphereArea(5)); // 314.1592653589793
```
2015-04-20 10:02:34 +00:00
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