LinearInterpolation
not ratedInterpolates linearly in between x1/y1 and x2/y2 depending on the position of p.
function LinearInterpolation takes real x1, real x2, real y1, real y2, real p returns real
if p <= x1 then
return y1
elseif p >= x2 then
return y2
else
return y1 + ((p - x1)/(x2 - x1)) * (y2 - y1)
endif
endfunctionNo comments.