

Alors voila, j'ai un point C qui se ballade entre A et B.
Je connait sa valeur x.
Comment puis je faire pour connaitre sa valeur y ? (il doit toujours se trouver sur le segment AB

j'ai essayé ca :
int a,b;
if(XC>XA && XC<XB)
{
a= (YA-YB)/(XA-XB);
b= YA-a*XA;
YC= (a*XC)+b;
}
mais ca marche pas, en gros YC est toujours egal a YA :/
quelqu'un a une idée ????
merci d'avance
