How to find a point on a line at a given distance from a given point on the same line (given the equation of the line)?

140 Views Asked by At

You are given a point P(x,y) on a line of equation ax + by + c = 0. I want another point, Q(a,b) on the same line which is at a distance d from P. There will be two points. I want to find both and know which side of P each one lies.

There are related questions in this forum, but I didn't get what I am exactly looking for. Sorry for beating around the bush, and thanks for any help... Please give me an elaborate explanation. Thanks once again!!!

2

There are 2 best solutions below

0
On BEST ANSWER

Let's call $A=(x,y)$ the point that you are looking for and $P=(x_0,y_0)$ so,

$$d^2=(x-x_0)^2+(y-y_0)^2 \quad (1)$$

and $A$ belong to the line, so $ax+by+c=0 \Rightarrow y=mx+e \quad (2)$. Replacing $(2)$ in $(1)$ we get:

$$d^2=(x-x_0)^2+(mx+e-y_0)^2 \Rightarrow$$ $$ (1+m^2)x^2+x[2m(e-y_0)-2x_0]+x_0^2+(e-y_0)^2-d^2=0$$

and solving the quadratic equation you will get those two points.

1
On

The direction of the given line is $$\binom {-b}a$$

So the two points you are looking for have position vectors $$\binom xy\pm\frac{d}{\sqrt{a^2+b^2}}\binom {-b}a$$