You have the interval [a,b] that you want to map to the new interval [c,d] and the x value in the original coordinates that you want to map to y in the new coordinates, Then:
y = c + (xa)*(cd)/(ba)
And for your example, with [a,b] = [0,440] and [c,d] = [-1,1] , with x=220 :
y = -1 + (220-0)*(1 - -1)/(440-0) = 0
etc.
By the way, this works even if x is outside [a,b] . Therefore, as long as you know any two values in both systems, you can convert any value in any direction.
Jim lewis
source share