class MathExt {

    public static double scale(double value, double min, double max) {
        Preconditions.checkArgument(min < max, "min must be less than max");
        return (value - min) / (max - min);
    }

}