[SOLVED] equation for a point on a known line
Say we are given the Cartesian points P1=(x1, y1) and P2=(x2, y2) and we are given a distance D1. What equation do I use to find the coordinates of the point P3=(x3, y3) that lies along the line segment between P1 and P2, and is a distance D1 from point P1?
P1--------------P3----------------------P2
|------D1-----|
Here is what I know how to find:
We can find the slope of the line (m) with m = (y2-y1)/(x2-x1).
We can find the distance between the two points (d) using d=sqrt((x2-x1)^2 + (y2-y1)^2).
The y-intercept (b) using b = y1 - m*x1.
The equation of the line in slope/intercept form: y = m*x + b.
The equation of the line in point-slope form: y = m(x-x1) + y1.
Here is my best guess at the solution:
x3=rx1+sx2/r+s
y3=ry1+sy2/r+s
But I don't know if this is correct (or if there needs to be ( ) somewhere in it) and if it is correct, I don't know what r and s are supposed to stand for.
Please grace me with your vast knowledge, O' great Internets.