Interpolate Functions

Deterministic interpolation and smoothing functions

NameParametersReturnsDescription
Interpolate.Blend(decimal a, decimal b, decimal weight)decimalBlends two values using weight (0..1).
Interpolate.Exponential(decimal a, decimal b, decimal t)decimalExponentially interpolates between a and b.
Interpolate.InverseLerp(decimal a, decimal b, decimal value)decimalReturns t (0..1) representing value between a and b.
Interpolate.Lerp(decimal a, decimal b, decimal t)decimalLinearly interpolates between a and b using t (0..1).
Interpolate.Logarithmic(decimal a, decimal b, decimal t)decimalLogarithmically interpolates between a and b.
Interpolate.Midpoint(decimal a, decimal b)decimalReturns the midpoint between two values.
Interpolate.SmootherStep(decimal a, decimal b, decimal t)decimalSmoother interpolation between a and b using t (quintic).
Interpolate.SmoothStep(decimal a, decimal b, decimal t)decimalSmooth interpolation between a and b using t (cubic).
Interpolate.Step(decimal threshold, decimal value)decimalReturns 0 or 1 depending on whether value is below threshold.

Examples

	
        Interpolate.Lerp(0, 100, 0.25)
        Interpolate.InverseLerp(0, 100, 25)

        Interpolate.SmoothStep(0, 1, 0.5)
        Interpolate.SmootherStep(0, 1, 0.5)

        Interpolate.Step(50, Price)
        Interpolate.Blend(Bid, Ask, 0.6)

        Interpolate.Midpoint(Low, High)
        Interpolate.Exponential(0, 1, 0.3)
        Interpolate.Logarithmic(0, 1, 0.7)