Calculess.js
A calculus library for javascript and NPM. Created by Blake Sanie.
Install
$ npm install calculess
Getting Started
Import package and create Calc object for future use
var Calculess = ;var Calc = Calculessprototype;
Documentation
Limits
Evaluate a limit
Calc
Evaluate a limit from the left
Calc
Evaluate a limit from the right
Calc
Methods:
- Accept ±Infinity as x value (parameter)
- Can output ±Infinity
- Output NaN when the limit does not exist
Examples:
{ return 1 / x;} Calc; // -InfinityCalc; // InfinityCalc; // NaNCalc; // 1
Derivatives
Evaluate f'(x)
- Note: If the given function is not continuous or differentiable at the target, NaN is returned
Calc
Evaluate a derivative to the nth degree of x
- Note: as the degree increases, .nthDeriv() becomes less accurate. Also, continuity and differentiability are not checked.
Calc
Examples:
{ return x * x;} Calc; // 6Calc; // 2Calc; // 0 { return Math;} Calc; // 1Calc; // 0Calc; // NaN
Integrals
Evaluate an integral using trapezoidal Riemann Sums
Calc
Evaluate a function's average value
Calc
Note: As the number of subintervals increases, .intregral() becomes more accurate, though more time is required for calculations
Examples
{ return Math;} Calc; // 1.9337655980928052Calc; // 1.9835235375094546Calc; // 1.999835503887445Calc; // 1.9999983550656886Calc; // 1.999999983550358