In the general case, if you need to convert Q = [A, B] to Q' = [A', B'] , where f(A) = B' and f(B) = A' , then an arbitrary X in the space [A, B] will have the following meaning for [A', B'] :
X' = X * k + d;
Where
k = (B' - A') / (A - B); d = A' - B * k;
So, for your case, we have A = 200 , B = 0 and A' = 5 , B' = 1 , as a result we get:
k = -1/50 d = 5
an arbitrary value of X from [0, 200] will be translated as follows:
x' = x * (-1 / 50) + 5;
source share