triangle-quadrature
v1.0.0
Published
Gaussian quadrature for a triangle
Downloads
9
Maintainers
Readme
triangle-quadrature
Gaussian quadrature for a triangle.
Usage
var bunny = require('bunny')
var quadrature = require('triangle-quadrature')([bunny.positions[0], bunny.positions[1], bunny.positions[2])
console.log(quadrature) # <- {positions: [...], weights: [...]}
require("triangle-quadrature")(positions, [order = 5])
Computes Gaussian quadrature for a triangle defined by positions
(three vec3s). Optionally, you can set a custom order, higher implying greater accuracy. To actually integrate using these quadrature points, simply take a sum of your integrand at positions
weighted by weights
.
Contributing
See stackgl/contributing for details.
License
MIT. See LICENSE.md for details.