Numerical Calculus
Tools for numerical differentiation, integration, and smoothing via SciMathJS.
Usage
typescript
import { SciMathJS } from '@velo-sci/sci-math-wasm';
const data = new Float64Array([1, 2, 4, 8, 16]);
const derivative = SciMathJS.diff5Pt(data, 1.0);API Reference
diff5Pt
Calculates numerical derivatives of a data series using a 5-point stencil for high accuracy.
Formula:
Signature:
typescript
function diff5Pt(data: Float64Array | number[], h: number): Float64ArrayintegrateSimpson
Computes the definite integral of a function using Simpson's 1/3 rule.
Formula:
Signature:
typescript
function integrateSimpson(data: Float64Array | number[], h: number): numbersmoothSG
Savitzky-Golay smoothing filter. Uses a polynomial regression of local points to smooth data while preserving peak shape.
Signature:
typescript
function smoothSG(data: Float64Array | number[], window: number): Float64Array