Map Value to Range

Map a value from one range to another.

Code

General
($value - $inMin) * ($outMax - $outMin) / ($inMax - $inMin) + $outMin;

Parameters

Value to map

Input range min

Input range max

Output range min

Output range max

Server

More PHP Snippets