I have a line defined by two points within the line, $A(x_1, y_1, z_1)$ and $B(x_2, y_2, z_2)$.

I have a third point $P(x_3, y_3, z_3)$.

How do I find the coordinates of the points on the line $AB$ which are $d$ units away from $P$ ?

  • $\begingroup$ Find the perpendicular distance of $P$ from the line, then slide along it either way, through a distance you get from Pythagoras. $\endgroup$
    – J.G.
    Dec 18, 2018 at 23:28
  • $\begingroup$ @J.G. how do I "slide along" it? $\endgroup$ Dec 18, 2018 at 23:28
  • $\begingroup$ @RossMillikan I don't think that's a dupe. Looks like they asked for finding a point on the line. I have 3 points. 2 define a line, one is away from it. If it is a dupe, idk how to re-apply the answer from the other question to this one. $\endgroup$ Dec 18, 2018 at 23:46
  • $\begingroup$ Sorry, I misread the question. i have reopened it. J.G.'s hint is a good one to make it a duplicate. If the distance from $P$ to the closest point on the line $Q$ is $p$, you want a point on the line that is $\sqrt {d^2-p^2} $ away from $p$. Now apply the other question $\endgroup$ Dec 18, 2018 at 23:48
  • $\begingroup$ Intersect the line with a sphere centered at $P$. $\endgroup$
    – amd
    Dec 19, 2018 at 0:14

1 Answer 1


If you write out $\|A+\alpha(B-A)-P\|^2=d^2$ you get a quadratic equation in $\alpha$. You can solve for $\alpha$ with standard methods.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .