mathsteps-test

1.0.2 • Public • Published

Mathsteps

Join the chat at https://gitter.im/mathsteps-chat/Lobby Build Status

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

const steps = mathsteps.solveEquation('2x + 3x = 35');

See all the change types

const changes = mathsteps.ChangeTypes;

Learn how to use mathsteps and how the codebase works.

Examples

Here is an example to get you started.

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.

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 to suggest more features, report bugs or contribute code.

Test

npm test

License

Apache-2.0

Package Sidebar

Install

npm i mathsteps-test

Weekly Downloads

7

Version

1.0.2

License

Apache-2.0

Last publish

Collaborators

  • nitin42