const mapNumRange = (num: number, inMin: number, inMax: number, outMin: number, outMax: number) =>
        ((num - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
      
      Typescript language logo

      Map range to another

      Codiga's TypeScript Recipes

      Maps a number from one range to another range.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.