


class M{
  static inv_lerp(from, to, inter){
    return (inter - from) / (to - from)
  }

  static lerp(from, to, value){
    return from + value * (to - from)
  }

  static remap(min_in, max_in, min_out, max_out, value){
    var inter = inv_lerp(min_in, max_in, value)
    return lerp(min_out, max_out, inter)
  }
}