# Get a Point on a Line which is Perpendicularly dropped from another Point

Let say I have this image,

(X1, Y1), (X2, Y2) and (X3, Y3) are known points. From point (X1, Y1), a line is dropped perpendicular to line (X2, Y2) and (X3, Y3). I need to calculate (Xn, Yn)

-
Relation for slopes of perpendicular lines is $m_1m_2=-1$ Just plug in the values of slopes of 2 lines. And another equation you will get from putting $(x_n,y_n)$ in the line equation. –  Saurabh Jun 26 '12 at 9:07
@SaurabhHota, Thanks. –  user960567 Jun 26 '12 at 9:13

you can easily find the equation of line joining two points.Suppose, $(X_n,Y_n)$ is the point of perpendicular projection from $(X_1,Y_1)$.We have two variables $X_n,Y_n$,so we need two independent equations.Condition 1, product of slopes of given line and line joining $(X_1,Y_1)$ and $(X_n,Y_n)$ is -1(as they are perpendicular).Second Condition,point $(X_n,Y_n)$ lies on the given line, hence satisfies its equation.Solution of these two equations will give the required point $(X_n,Y_n)$.
Here's how you can find it. You can find the slope of the line $L$ containing the points $(x_2,y_2)$ and $(x_3,y_3)$: you can then find the slope of the line $M$ through $(x_1,y_1)$ and $(x_n,y_n)$ (since these lines are perpendicular). Now are in a position to find the equations of $L$ and $M$, and hence the point of intersection, namely $(x_n,y_n)$.