scale to defined range

scale_to_range(x, min, max)