I think this question is best asked on concrete-ish terms, so, here it goes.
Let's say we have 4 wires, all with common ground:
A) ≈9V-20V, varying.
B) ≈3V-6V, varying.
C) A low frequency analog signal (<1kHz), which can vary from 0 to A.
D) In here, I need to output the analog signal from wire C, but translated from range 0-A to range 0-B.
Point of the circuit being that it should self adjust to always translate the signal from range 0-A to range 0-B, even if A, B or both change.
I'm basically stuck, any pointer or a suggestion would be appreciated.