Skip to main content
The Deno 2 Release Candidate is here
Learn more
method MathUtil.prototype.interp1
import { MathUtil } from "https://deno.land/x/sptaki@1.2.0/utils/MathUtil.d.ts";

Linear interpolation e.g. used to do a continuous integration for quest rewards which are defined for specific support centers of pmcLevel

Parameters

xp: number

the point of x at which to interpolate

x: number[]

support points in x (of same length as y)

y: number[]

support points in y (of same length as x)

Returns

number

y(xp)