Equations defining Projection in Plane/Cartesian

Theorem
Let $M$ and $N$ be distinct lines in the plane, both of which pass through the origin.

Let the angle between $M$ and the $x$-axis be $\theta$.

Let the angle between $N$ and the $x$-axis be $\phi$.

Let $\pr_{M, N}$ be the projection on $M$ along $N$:
 * $\forall P \in \R^2: \map {\pr_{M, N} } P =$ the intersection of $M$ with the line through $P$ parallel to $N$.

Let $P = \tuple {x, y}$ be an arbitrary point in the plane.

Then:
 * $\map {\pr_{M, N} } P = \begin {cases}

\tuple {0, y - x \tan \phi} & : \theta = \dfrac \pi 2 \\ \tuple {x, x \tan \theta} & : \phi = \dfrac \pi 2 \\ \tuple {\dfrac {x \tan \phi} {\tan \phi - \tan \theta} - \dfrac y {\tan \phi - \tan \theta}, \dfrac {y \tan \theta} {\tan \theta - \tan \phi} - \dfrac {x \tan \theta \tan \phi} {\tan \theta - \tan \phi} } & : \text {otherwise} \end {cases}$

Proof
Let $P = \tuple {x_1, y_1} \in \R^2$ be arbitrary.


 * Projection-in-plane-equation.png

From Equation of Straight Line in Plane: Slope-Intercept Form, we can express $M$ and $N$ as follows:

where:

Let $\pr_{M, N}$ map $P = \tuple {x_1, y_1}$ onto $P' = \tuple {x_2, y_2}$.

From Equation of Straight Line in Plane: Point-Slope Form, $PP'$ can be expressed as:
 * $y - y_1 = n \paren {x - x_1}$

This holds also for $\tuple {x_2, y_2}$, and so:

Similarly:

The result follows by substituting for $m$ and $n$.