Linear interpolation helper for doubles
static double lerpDouble(double a, double b, double t) { return a + (b - a) * t; }