This is less of a graphics question per se and more of a general math

question. Suppose you have an interval [a,b] and a point p in this interval.

Additionally, you have another interval [c,d] and a point p' in this

interval. Given that a, b, c, d, p, and p' all represent real numbers, what

is the general formula for deriving p' from p?

The classic example I happened to think of is the Celsius to Fahrenheit

conversion, in which [a,b] is [0,100] and [c,d] is [32,212]. Suppose that p

= 50. Then p' = (9/5)*p + 32 = 122.

This general strategy doesn't seem to work for an arbitrary scale, though.

Following the C-to-F guidelines, I couldn't seem to derive a formula for

converting, say, [1,4] to [3,7].

Any hints?