# Computing endpoint coordinates of point P of a line of known length d that ends perpendicularly at the known mid-point coordinates of another line

Is there a simple formula that gives the coordinates of a point P, which is the endpoint of a line of length d that passes perpendicularly through the midpoint of another line? The distance d of the endpoint P from the midpoint m of the perpendicular line is known.

For instance, if the coordinates of the endpoints of the perpendicular line are $$(x_1,y_1)$$ and $$(x_2,y_2)$$, then it is easy to figure out the coordinates of the mid-point $$((x_1+x_2)/2, (y_1+y_2)/2)$$. See the figure for clarification.enter image description here

• – amd
Apr 1, 2019 at 21:58
• Also effectively a duplicate of math.stackexchange.com/q/1748456/265466: once you have the midpoint, your problem reduces to this one.
– amd
Apr 1, 2019 at 21:59

Hints

• The slope of $$d$$ is given by $$m_d=\frac{x_1-x_2}{y_2-y_1}$$

• The midpoint $$M$$ of the segment has the coordinates $$M\bigg(\frac{x_1+x_2}{2} \mid \frac{y_1+y_2}{2}\bigg)$$

• If $$P$$ has the coordinates $$P(x_p\mid y_p)$$, then $$d^2=\big (\frac{x_1+x_2}{2}-x_p\big)^2+\big(\frac{y_1+y_2}{2}-y_p\big)$$

• What if $y_1=y_2$?
– amd
Apr 1, 2019 at 21:57
• If $y_1=y_2$ the problem is quite easy to solve: $P=(\frac{x_1+x_2}{2},y_1 \pm d)$. Apr 1, 2019 at 22:12
• The value of distance d of point P from the midpoint is already known. Also, the coordinates of the midpoint are known or can easily be computed. The question is what would be the value of the coordinates of point P in terms of the midpoint coordinates and the distance d? Apr 2, 2019 at 12:18
• amd pointed out that this is question might be a duplicate of math.stackexchange.com/questions/1748456/… I will have to check out that solution to see if it works or not. Apr 2, 2019 at 12:36