I have tried to find posts that are related to the question but they end up with the terms like ‘find a distance’. What I want is not to find the distance: I already have the distance, I want something else.

Assume $(x_1,y_1)$ and $(x_2,y_2)$ are points on the line $y=ax+b$ and the euclidean distance between the points is defined as $d=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$.


point $(x_1,y_1)$
line $y=ax+b$
distance $d$


point(s?) $(x_2,y_2)$

I want to know whether I am on the right path. Should I solve for the line and the distance formula to find $x_2,y_2$? Is this the right way? Is there any faster way of doing this?

  • $\begingroup$ p.s, I used the online latex formula creator to display the distance formula but it did not work. A link to how-to do formulas on math.stackexchange is appreaciated. $\endgroup$ – Aaron Azhari Jun 2 '14 at 20:11

The vector that traverses parallel to the line is $(1,a)$. Normalize this vector by dividing by $\sqrt{1 + a^2}$ to get vector $v$ in the same direction that has length $1$. Then your desired point is $w \pm d\cdot v$ where $w$ is the original point and $d$ is the desired distance.

  • $\begingroup$ does normalizing (1,a) means $(1/\sqrt{1+a^2},a/\sqrt{1+a^2})$ ? $\endgroup$ – Aaron Azhari Jun 2 '14 at 20:22
  • $\begingroup$ and what do you mean by w being the point? Do you mean w as $(x1,y1)$ which becomes $(x1\pm d,y1\pm d)$ ? $\endgroup$ – Aaron Azhari Jun 2 '14 at 20:26
  • $\begingroup$ Yes that's what I mean by normalizing. And $w = (x_1,y_1)$ and $v = (v_1,v_2)$ where $v_1 = 1/\sqrt{1+a^2}$ and $v_2 = a/\sqrt{1+a^2}$ and your desired point is $(x_1\pm dv_1,x_2 \pm dv_2)$. $\endgroup$ – user2566092 Jun 2 '14 at 20:31

The point(s) that you are looking for are the points at which the circle $$(x-x_1)^2+(y-y_1)^2=d^2$$ and the line $$y=ax+b$$ intersect. Therefore $$(x-x_1)^2+(ax+b-y_1)^2=d^2$$ which is a quadratic equation in $x$.


Let $(x_{1},x_{2})$ be a known point on the line


Now you may denote any point on this line by


If $d$ is the distance between the points then


Hence, you have to solve a quadratic equation in x.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.