Northern Pileated Marmoset
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

gauss-quadrature

1.0.0 • Public • Published

gauss-quadrature

This library computes Gauss-Legendre quadrature points and weights for numerical integration. For more information, see:

Example

var gaussQ = require("gauss-quadrature")
 
console.log(gaussQ(2))
 
//Prints:
//
//  [ [ -0.5773502691896257, 0.5773502691896257 ], [ 1, 1 ] ]
//

Install

npm install gauss-quadrature

require("gauss-quadrature")(n[, a, b])

Computes the Gaussian quadrature points and weights for the interval [a, b].

  • n is the number of quartature points
  • a is the start of the interval (default -1)
  • b is the end of the interval (default +1)

If either a or b is unspecified, the interval defaults to [-1, 1]

Returns An array with two elements, [x, w] where:

  • x is the list of quadrature points
  • w is the list of quadrature weights

Note

Quadrature points are only accurate to 1e-6

Credits

(c) 2013 Mikola Lysenko. MIT License

install

npm i gauss-quadrature

Downloadsweekly downloads

3

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar