Need help transform one Point to another. This is probably ultra basic stuff, but I'm very rusted and don't know how to do this.
Lets say I have 5 values:
upperLimit $= 600$      
value $= 589$  
lowerLimit$ = 500$  
upperLimitY $= 250 $
lowerLimitY $= 273$
How do I find out the value of the point valueY, that should relatively have the same position in between upperLimitY and lowerLimitY as value has between upperLimit and lowerLimit?
I am looking for a formula that lets me input a value and give me the corrosponding valueY.
Some additional information:  


*

*upperLimit is ALWAYS bigger than lowerLimit

*upperLimit and lowerLimit may be negative

*upperLimitY is ALWAYS smaller than lowerLimitY

*upperLimitY and lowerLimitY are ALWAYS positive

*value can be anything, even values bigger than upperLimit or smaller than lowerLimit, whats important for me is the relative position


I've been grinding my head through this for an hour but I haven't done math like this in way too long time.
 A: You want linear interpolation.
$m=\frac{y_{1}-y_{}}{x_{1}-x_{0}}$
then $y=y_{0}+m x_{0}$
A: The formula you need is
$$
valueY = lowerlimitY + (valueX - lowerlimitX)* 
\frac{upperLimitY - lowerlimitY}{upperLimitX - lowerlimitX}
$$
There's a geometric reason for this: the point $(valueX, valueY)$ needs to lie on the straight line between the two points $(lowerLimitX,lowerLimitY)$ and $(upperLimitX,upperLimitY)$. That's what the formula above ensures. The fraction on the right-hand side is the slope of the line through these two points. The nice thing is that you only need to calculate this slope once, and then calculating new $valueY$ values from newly given $valueX$ values is very easy.
I'm guessing that you can plug in the numbers yourself.
A: $\quad\quad\quad\quad\quad\quad\quad\quad$
If we look at it like this, with the condition that the ratios of the lengths are the same, we can get the following equality. $$\frac{x-x_{min}}{x_{max}-x_{min}}=\frac{y-y_{min}}{y_{max}-y_{min}}$$
We can then rearrange for $y$ & substitute the other values.
