Hacker News new | ask | show | jobs
by Xeanort 2530 days ago
You want a linear function f(x) such that f(a)=A and f(b)=B given a, b, A, B. A valid f(x) (actually it's the only one) is defined as

             x-b     x-a
    f(x) = A --- + B ---
             a-b     b-a
You can calculate f(a) and f(b) to confirm that it works.

However, I don't find this kind of guide any good for learning math...