iam try to find the next point on the same slope of an line i I had a problem when I tried to add A small number to find the next point add it the next point The distance has become very large i try on this formula:
slope = (P2.Y - P1.Y) / (P2.X - P1.X);
nx2 = P2.X +add;
ny2 = P2.Y+ slope * add;
The nx2 is the next x , ny2 is the next y and p1,p2 is the point1 and point2; add : is the number i want to add in this case i used 18
so i used this formula in this exmaple this tow point {X=517, Y=336}--{X=505, Y=530.5} the next point is *{x=535,y=44} i just add 18 for * but on othe point the distance is normal but on other point like this distance be very far
thank you
This is doing what it should. Your first two points have an $x$ difference of $12$ and a $y$ difference of about $-200$. The third point is $18$ away in $x$, so the $y$ difference should be about $\frac {18}{12}(-200)=-300$ and it is.