Menu

gitpiper

mapNumRange javascript Code Snippet in 2024

mathbeginner

Last Updated: 11 April 2024

Maps a number from one range to another range.

  • Return num mapped between outMin-outMax from inMin-inMax.
const mapNumRange = (num, inMin, inMax, outMin, outMax) => ((num - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
mapNumRange(5, 0, 10, 0, 100); // 50

javascript snippet similar to mapNumRange For You in April 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️