function interpolate(min, max, ratio) {
  return Math.floor(ratio * ((max + 0.5) - min) + min);
}
function interpolate(min, max, ratio) {
  return Math.floor(ratio * ((max + 0.5) - min) + min);
}
function interpolate ( min , max , ratio ) { return Math . floor ( ratio * ( ( max + 0.5 ) - min ) + min ) ; }
Given float `ratio` in [0, 1], return integer value in [min, max]. interpolate(min, max, 0.0) === min interpolate(min, max, 1.0) === max
Given float ratio in [ 0 1 ] return integer value in [ min max ] . interpolate ( min max 0 . 0 ) === min interpolate ( min max 1 . 0 ) === max