inverseLerp

fun inverseLerp(start: Double, stop: Double, value: Double): Double

Returns the fraction at which value lies between start and stop.

This is the inverse of lerp: inverseLerp(a, b, lerp(a, b, t)) is t up to floating point representation. The result is not clamped. Returns 0.0 when start equals stop to avoid dividing by zero.