Hey everyone!

I’m stuck trying to develop a simple algorythm, since I’m not really good at maths.. I’ll try to explain the best I can my issue:

I have a variable X, and its value goes from a minimum of A, to a maximum of B, where A and B are values between 0.0f and 1.0f, and B is always greater than A. all these values, X, A and B are already set up in my equation, the new value I need to calculate is a percentage, let’s say a Y variable between 0f and 1f, wich represents the “proximity” of X towards the A value (or the B value, it doesn’t matter), this means that if X is equal to A, Y will be equal to 0, if X ==B Y will be 1f, and if X is half way between A and B, Y will be 0.5f.

I REALLY bad at algorythms, so can anyone help me out here!?

THANK YOU!!