static double relativeToRange(double x, DoubleRange r) { ret doubleRatio(x-r.start, r.length()); }