public static double Clamp(this double v, double min, double max) => v < min ? min : v > max ? max : v;