<s>[INST] Compute the intersection of perpendicular lines Lines Ax + By = C and Bx – Ay = 0 are perpendicular.
I am trying to understand how their intersection is computed below:
$$ x = \frac{AC}{A^2 + B^2}$$
$$ y= \frac{BC}{A^2 + B^2}$$
I tried solving for y first but I am  not sure how to continue:
$$ Ax+By-C= Bx-Ay $$
$$By+Ay =-Ax +C +Bx $$
$$y(B+A) = -Ax +C +Bx$$
$$y= \frac{-Ax + Bx +C}{ B +A} $$
$$y= \frac{x(-A +B) +C}{ B +A} $$
 [/INST] If $B \ne 0$, then
$Bx - Ay = 0 \iff x = \dfrac ABy$
Substituting into $Ax+By=C$, we get
\begin{align}
   \dfrac{A^2}{B}y+By=C 
   &\implies A^2y + B^2y = BC \\
   &\implies y = \dfrac{BC}{A^2+B^2} \\
   &\implies x = \dfrac ABy = \dfrac{AC}{A^2+B^2}
\end{align}
If $B=0$ and $A \ne 0$, then $Ax+By=C \implies Ax=C \implies x = \dfrac CA$
and $Bx-Ay=0 \implies -Ay=0 \implies y=0$. Which is consistent with
$$(x,y) = \left(\dfrac{AC}{A^2+B^2}, \dfrac{BC}{A^2+B^2} \right)$$
</s>