[Math] Find intersection point of two straight lines

linear algebra

I want to find the intersection point of two lines where, one of the lines is parallel to y axis.
I know we can find the intersection point of two line by solving the equation $y=m(x-P_x)+P_y$
where m is the slope
and $(P_x,P_y)$ are the given coordinates.

but when the line is parallel to y axis, its slope is not defined. In that case, how to solve the equations and how to find the angle between those two lines?

Best Answer

Take the general form $Ax + By + C = 0$ and $A_2x + B_2y + C_2 = 0$

Then the point of intersection will be $(\frac{B*C_2 - B_2*C_1}{A*B_2-A_2*B} , \frac{C*A_2 - A_1*C_2}{A*B_2-A_2*B})$

Now take $B_2$ as zero because line is parallel to y-axis.

Thus the new point of intersection will be $(\frac{B*C_2}{-A_2*B} , \frac{C*A_2 - A_1*C_2}{-A_2*B})$ = $(\frac{-C_2}{A_2} , \frac{A_1*C_2 -C*A_2}{A_2*B})$

And to find the angle between those two lines. enter image description here

Related Question