thank you , I found the answer ,
n = (Y1-X1) / (R1-R2)
R1 = rate of change for X which is (x2-x1) / total time duration
R2 = rate of change for Y which is (y2-y1) / total time duration