from01 function

Helper function to scale from [0,1] to [min,max]