I tried searching, but due to the nature of my question, I was unable to find something satisfactory.
My problem is the following: I am trying to map numbers ranging fro
To map [A, B] --> [a, b] use this formula (val - A)*(b-a)/(B-A) + a
as correctly mentioned in the other answer it's linear mapping.
Basically
y = m*x + c c = intersection at y-axis m = slope determined by two known point (A, a), (B, b) = (b-a)/(B-A)