1.2.0 • Published 1 year ago

riemann-sum-calculator v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Riemann-Sum-Calculator

A Javascript utility class for calculating riemann sums with right sum, left sum, midpoint sum, and trapezoid sum methods.

Installation

npm i riemann-sum-calculator

Features

Allows user to calculate the right, left, midpoint or trapezoid riemann sum for any function, algebraic or transcendental functions.

Setup

import { Riemann } from "riemann-sum-calculator"

Usage

The Riemann sum utitlity class has four methods. One for each method of calculating a riemann sum: Riemann.rightSum(), Riemann.leftSum(), Riemann.midpointSum(), Riemann.trapezoidSum().

Each method accepts an object with properties expression: string, the function, subintervals: number, the number of subintervals, lowerBound: number, upperBound: number, the bounds of the Riemann sum.

Example

import { Riemann } from "riemann-sum-calculator"

const problem = {
    expression: "sin(x)",
    subintervals: 6,
    lowerBound: 0,
    upperBound: Math.PI / 2
}

console.log(Riemann.trapezoidSum(problem))
//outputs 0.994
1.2.0

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago