diffeq

1.0.3 • Public • Published

diffeq

Library to differentiate string representations of equations.

I originally started writing this to solve a Codewars kata, but I wanted to keep fleshing it out because the problem intrigued me.

Important Functions

differentiate(equation)

Function takes a string representation of a simple function, differentiates, and returns the result as a string.

All strings are assumed to be an expression set equal to y.

^ is used to represent exponents. For example, '2x^2' represents 2x squared.

differentiateAndEval(equation, value)

Function takes a string representation of a simple function, differentiates, and returns an evaluation of numeric value of y based on the given value for x.

All strings are assumed to be an expression set equal to y.

^ is used to represent exponents. For example, '2x^2' represents 2x squared.

Contribution

Pull requests are always welcome. Code will only be accepted with appropriate unit tests.

Readme

Keywords

none

Package Sidebar

Install

npm i diffeq

Weekly Downloads

5

Version

1.0.3

License

GPL-3.0

Last publish

Collaborators

  • bactroid