Using vector math to get point on perpendicular line from a point with the same Y My apologies for the non-perfect diagram made in paint.

So I have a line from P_0 to P_1, and I am currently at the point P_c. With those three points/two vectors, how can I get point P_2, which lies on the line perpendicular to the first and passing through P_1, and has the same Y coordinate as P_c, by using dot or cross products/vector math? 
I know how to solve for the point in question algebraically using the equation of a line, but I am wondering if there is an easier way to do it using vector math concepts. 
 A: The easiest way to deal with this problem is using homogeneous coordinates.


*

*Points $P_0$ and $P_1$ have homogeneous coordinates 
$$\begin{align} P_{0} & = \pmatrix{x_0\\y_0\\1} & P_{1} & = \pmatrix{x_1\\y_1\\1} \end{align}$$

Rule 0 - The homogeneous coordinates of a point $P$ located at $(x,y)$ are $P=\pmatrix{x & y & 1}$.


*The coordinates of the line connecting $P_0$ and $P_1$ is (see Rule 4 below)
$$L = P_{0} \times P_{1} = \pmatrix{y_0-y_1 \\ x_1-x_0 \\ x_0 y_1 - x_1 y_0}$$ 

Rule 1 - The coordinates of a line $L=\pmatrix{a &b&c}$ are the coefficients of the equation $ax+by+c=0$.


*The line perpendicular to $L$ through $P_{1}$ is
$$ N = \pmatrix{ x_1 - x_0 \\ y_1 - y_0 \\ x_1 ( x_0-x_1) + y_1 (y_0-y_1)} $$ 

Rule 2 - The line perpendicular to $L=\pmatrix{a&b&c}$ through $(x,y)$ is the line $N=\pmatrix{b & -a & a y-b x}$


*The horizontal line through $P_c$ is 
$$H = \pmatrix{0 \\ 1 \\ -y_c}$$

Rule 3 - The line with direction vector $e=(e_x,e_y)$ through a point $(x,y)$ has coordinates $H=\pmatrix{-e_y & e_x & x\, e_y-y\, e_x}$


*The point $P_2$ where $N$ and $H$ intersect is $$ P_2 = N \times H = \pmatrix{ x_1 (x_1-x_0) + (y_0-y_1) (y_c-y_1) \\ y_c (x_1-x_0) \\ x_1-x_0 }$$

Rule 4 - The homogeneous coordinates of a point $P$ where two lines $N$ and $H$ intersect is simply $P=N \times H$.
Rule 5 - The homogeneous coordinates of a line $G$ where two points $P$ and $Q$ meet is simply $G=P \times Q$


*The cartesian coordinates of point $P_c$ is $$\vec{p}_C = \pmatrix{ x_1 + \frac{  (y_1-y_0) (y_1-y_c)}{x_1-x_0} \\ y_c }$$

Rule 6 - The cartesian coordinates of a point $G=\pmatrix{g_x & g_y & g_w}$ are $\left( \frac{g_x}{g_w}, \frac{g_y}{g_w} \right)$.

NOTE: $\times$ is the regular vector cross product applied to 3×1 homogeneous coordinates.

So algorithmically the above is
' Given points P0, P1 and Pc find P2
P0 = [x_0, y_0, 1] 
P1 = [x_1, y_1, 1] 
Pc = [x_c, y_c, 1]
e  = [1, 0, 0] 
L = CROSS(P0, P1)
N = ORTH_THRU(L, P2)
H = LINE_DIR(e, Pc)
P2 = CROSS(N, H)
[x_2,y_2] = [P2(1)/P2(3), P2(2)/P2(3)]

' Cross product function
CROSS(a, b) = [a(2)*b(3)-a(3)*b(2), a(3)*b(1)-a(1)*b(3), a(1)*b(2)-a(2)*b(1)]

' Directed Line
LINE_DIR(e, p) = [-e(2)*p(3), e(1)*p(3), p(1)*e(2)-p(2)*e(1)]

' Orthogonal Line
ORTH_THRU(g, p) = [g(2)*p(3), -g(1)*p(3), g(1)*p(2)-g(2)*p(1)]

A: You can set $P_2=(x,y_c)$ and find $x$ by imposing dot product 
$(P_1-P_0)\cdot(P_2-P_1)$ to vanish:
$$
(x_1-x_0)(x-x_1)+(y_{1}-y_{0})(y_{c}-y_{1})=0,
$$
that is:
$$
x=-{(y_{1}-y_{0})(y_{c}-y_{1})\over(x_1-x_0)}+x_1
$$
