# find increment amount to get from $(x_1,y_1)$ to$(x_2,y_2)$ one dot at a time

If I have two points on positive cartesian coordinates, how do I find:

1. The slope of a line between those points
2. the increment amount to get from $(x_1,y_1)$ to$(x_2,y_2)$ one dot at a time.

What I know so far is $m=(y_2-y_1)/(x_2-x_1)$

But that gives me a single number, I need a pair of numbers I can add to $x$ and $y$ over the course of a series of iterations to reach $(x_2,y_2)$.

Thanks

-

For every increment (displacement) $t$ that you add to the $x$-coordinate, you add $mt$ to the $y$ coordinate. So $(x,y)$ becomes $(x+t,y+mt)$.
@alphablender: That's correct. And if you want exactly $n$ increments to go from $(x_1,y_1)$ to $(x_2,y_2)$, just make the increment equal to the $x$-interval divided by $n$. In other words, make $t=(x_2-x_1)/n$. –  anon Aug 5 '11 at 0:16