UNPKG

numerical-methods

Version:

A library that I made while studying Computer Science at UFPB. Documentation's available through TypeScript.

36 lines (34 loc) 1.08 kB
type Interpolation = (data: Interpolation.Params) => Interpolation.Return; declare namespace Interpolation { interface Params { x: number[]; y: number[]; targetX?: number; } type Result = string; interface Details { targetResult?: number; } interface Return { result: Interpolation.Result; details: Interpolation.Details; } type Newton = (data: Interpolation.Newton.Params) => Interpolation.Newton.Return; namespace Newton { type Params = Interpolation.Params; type Return = Interpolation.Return & { details: { dividedDifferences: number[][]; }; }; } } declare const interpolationParams: { x: string; y: string; targetX: string; }; declare const lagrangeInterpolation: Interpolation; declare const vandermondeInterpolation: Interpolation; declare const newtonInterpolation: Interpolation.Newton; export { Interpolation, interpolationParams, lagrangeInterpolation, newtonInterpolation, vandermondeInterpolation };