pub fn frac(v0: f64, v1: f64, threshold: f64) -> f64
Interpolation fraction for threshold crossing between v0 and v1.