-- @Description Basic linear interpolation
-- @Arg1 Time
-- @Arg2 StartingValue
-- @Arg3 EndingValue

function Interpolate.Linear(p0, p1, t)
	t = math.clamp(t, 0, 1)
	return (1-t)*p0 + t*p1
end

function Interpolate.QuadInOut(t)
	return t < 0.5 and 2 * t * t or 1 - math.pow(-2 * t + 2, 2) / 2
end

function Interpolate.Bezier(p0, p1, p2, t)
	return (1 - t)^2 * p0 + 2 * (1 - t) * t * p1 + t^2 * p2
end

return Interpolate
