In other programming languages such as processing, there is a function which allows you to convert a number that falls within a range of numbers into a number within a diffe
Let's say you have 6 variables :
To have the range :
interval = maxRange - minRange; rangeX = interval * x / browserWidth + minRange rangeY = interval * y / browserHeight + minRange