Adjust a range of given values.

98 Views Asked by At

If I have a number anywhere on the range 140 - 350 and I want to match it to the correlated range "0 - 360" what function can I run it through?

i.e.:
140 would go through the function and return 0.
350 would go through the function and return 360.
245 (midpoint of Range 1) would go through the function and return 180 (midpoint of Range 2).



I have a feeling the answer will involve using percentages.

1

There are 1 best solutions below

0
On BEST ANSWER

You are correct, assuming you want the function to be linear. Let $f(x)$ be your function. We are given that $f(140)=0$ and $f(350)=360$. Using the slope formula, we obtain: $$ m=\dfrac{360-0}{350-140} = \dfrac{360}{210} = \dfrac{12}{7} $$

Using the point-slope formula, we obtain: $$ f(x)-0 = \dfrac{12}{7} \cdot (x-140) $$

or simply:

$$ f(x)= \dfrac{12}{7}x-240 $$