I'm writing a program in which I have to draw something along a line multiple time and spaced evenly. I used two points [$(x_1,y_1)$ and $(x_3, y_3)$] to create a line. Then I found out the equation $y = mx+b$ of the line going through those two points. Now I want to draw multiple time between those two points with a distance $d$ between each drawing [first drawing is at $(x_1, y_1)$].
I know the squared distance between two points in a coordinate system is $d^2 = (x_1 - x_2)^2 + (y_1 -y_2)^2$. But I am not sure how to figure out $x_2$ and $y_2$ from there. is it even possible? is there another way to know $x_2$ and $y_2$ with all the other known information?
$(x_2-x_1)^2+(y_2-y_1)^2=d^2$ is in fact the equation of a circle with radius $d$ and center on $(x_1, y_1)$, so to find $x_2$ and $y_2$ you have to find the intersection of line $y=mx+b$ with this circle , that is you have to solve following system of equation:
$\begin{cases}(x-x_1)^2+(y-y_1)^2=d^2\\ y=mx+b\end{cases}$
You have $x_1$, $y_1$ and $d$ so you can find x and y which in fact is $x_2$ and $y_2$