Package Exports
- mathsteps
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mathsteps) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
A step by step solver for math
https://www.youtube.com/watch?v=ay6GjmiJTPM
NOTE: not ready for contributers
Be aware that this repo's file structure will be going through some changes to get ready for our release mid-January. At that point, we'll be publishing a blog post where you can learn more about how this repo works, and we'll be welcoming contributers! You're welcome to play around with this before then, but we won't be taking pull requests until after our release. Thanks!
Usage
To install mathsteps using npm:
npm install mathsteps
const mathsteps = require('mathsteps');
const steps = mathsteps.simplifyExpression('2x + 2x + x + x');
steps.forEach(step => {
console.log("before change: " + step.oldNode); // before change: 2 x + 2 x + x + x
console.log("change: " + step.changeType); // change: ADD_POLYNOMIAL_TERMS
console.log("after change: " + step.newNode); // after change: 6 x
console.log("# of substeps: " + step.substeps.length); // # of substeps: 3
});
To solve an equation:
const steps = mathsteps.solveEquation('2x + 2x + x + x');
To see all the change types:
const changes = mathsteps.ChangeTypes;
Contributing
Hi! If you're interested in working on this, that would be super awesome! Learn more here: CONTRIBUTING.md.
Build
First clone the project from github:
git clone https://github.com/socraticorg/mathsteps.git
cd mathsteps
Install the project dependencies:
npm install
Test
To execute tests for the library, install the project dependencies once:
npm install
Then, the tests can be executed:
npm test