https://github.com/nitin42/mathsteps-clone
Step by steps math solutions for everyone
https://github.com/nitin42/mathsteps-clone
Last synced: 3 months ago
JSON representation
Step by steps math solutions for everyone
- Host: GitHub
- URL: https://github.com/nitin42/mathsteps-clone
- Owner: nitin42
- License: apache-2.0
- Created: 2017-02-03T09:37:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-25T19:04:58.000Z (over 8 years ago)
- Last Synced: 2025-01-12T23:11:22.431Z (5 months ago)
- Language: JavaScript
- Homepage: https://socratic.org
- Size: 658 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# Mathsteps
[](https://gitter.im/mathsteps-chat/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://travis-ci.org/socraticorg/mathsteps)Mathsteps is a step-by-step math solver. It helps in solving equations, simplifying an expression and factoring a polynomial. (more to come 😄)
**Solve an equation**
```javascript
const steps = mathsteps.solveEquation('2x + 3x = 35');
```**See all the change types**
```javascript
const changes = mathsteps.ChangeTypes;
```
Learn [how to use mathsteps](https://github.com/socraticorg/mathsteps/wiki/How-to-use-mathsteps) and [how the codebase works](https://github.com/socraticorg/mathsteps/wiki/Mathsteps-organization).## Examples
Here is an example to get you started.```javascript
const mathsteps = require('mathsteps');const steps = mathsteps.simplifyExpression('2x + 2x + x + x');
steps.forEach(step => {
console.log("before change: " + step.oldNode);
console.log("change: " + step.changeType);
console.log("after change: " + step.newNode);
console.log("no of substeps: " + step.substeps.length);
});/*
before change: 2 x + 2 x + x + x
change: ADD_POLYNOMIAL_TERMS
after change: 6 x
no of substeps: 3
*/
```
In this example we have an equation `2x + 2x + x + x` that is being simplified by the method `simplifyExpression`. It returns the output which tells about the equation before and after applying the change, what change was applied and the no of substeps.## Installation
Mathsteps is available as the `mathsteps` package on [npm](https://www.npmjs.com/package/mathsteps).
```
npm install mathsteps --save
```## Contributing
The main objective of the mathsteps is to continue to evolve and provide more operations and features. Read below to learn how can you contribute to the project.**Contributing guide**
Read our [contributing guide](CONTRIBUTING.md) to suggest more features, report bugs or contribute code.## Test
```
npm test
```## License
Apache-2.0