How do I prove the formula for distance from point to line $\mathbf{(p_2-p_1)} \times \mathbf{(p_1-p_0)} / ||\mathbf{(p_2-p_1)} ||$? Per wiki
the distance from a line in the plane given by the equation $ax+by+c=0$ to a point $\mathbf{p_0} (x_0, y_0)$ is:
$$\operatorname{distance}(ax+by+c=0, (x_0, y_0)) = \frac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}}. $$
I clearly understand all above.
per a post, suppose the line $ax+by+c=0$ goes through two points $\mathbf{p_1} (x_1, y_1)$ and $\mathbf{p_2} (x_2, y_2)$, the distance can also be computed with $\mathbf{p_1}$ and $\mathbf{p_2}$.
$$\mathbf{(p_2-p_1)} \times \mathbf{(p_0-p_1)} / ||\mathbf{(p_2-p_1)} ||$$
where $||\mathbf{(p_2-p_1)}||$ denotes the L2 norm of it and $\times$ means cross product.
How do I prove the statement algebraically?
By "algebraically" I mean something like this one, because cross product is only for 3d vectors in terms of geometry which indicates it might be difficult to produce some geometric arguments to prove the formula above.
However, the proof doesn't have to be an algebraic one, a geometric one is also appreciated.
 A: Okay let me type the geometric proof from the comments in more clear language
The terms in the cross product represent vectors from $p_1$ to $p_0$ and $p_2$ respectively. The cross product then gives you the area of the parallelogram spanned by these two vectors.
We know from high school how we can compute the surface area of a parallelogram: take one side (the vector $p_2 - p_1$) and the altitude line from the opposing corner of the parallelogram ($p_0$) to that side and multiply their lengths.
Now the length of the altitude is the quantity you want to compute, the desired distance. The length of the side $p_2 - p_1$ is the $L^2$-norm you have in the denominator. So we get:
The desired quantity times the norm of $p_2 - p_1$ equals the cross product of $(p_2 - p_1)$ and $(p_0 - p_1)$.
The equation then follows.
A: First of all, even though your the equation has two variables, $x$, $y$, which you would at first be led to think that it lies in a two-dimensional space, say $\mathbb{R}^{2}$. In order to be able to use "cross product" that is defined in three-dimensional space, you have to consider the equation as something that is defined in three-dimensional space. Hence, this equation represents a plane in a three-dimensional space with its $z$ variable is equal to $0$ as in $ax + by + cz + d = 0$ with $z = 0$.
Secondly, your vector-valued equation for distance above,
$$( \mathbf{p_2-p_1}) \times (\mathbf{p_0-p_1}) / ||( \mathbf{p_2-p_1}) ||$$
requires a little correction as it is supposed to produce a scalar value rather than a vector. Because cross product outputs a vector, and its scalar multiple is still a vector. Therefore, the correct form becomes,
$$\frac{|| (\mathbf{p_2-p_1}) \times (\mathbf{p_0-p_1}) ||}{||(\mathbf{p_2-p_1}) ||}$$
From comments above I assume you meant to derive this equation using vector algebra. If so, let $\mathbf{p_0}$, $\mathbf{p_1}$ and $\mathbf{p_2}$ represent "vectors" from origin in $\mathbb{R^3}$. We also have the magnitude relation of cross product,
$$|| \mathbf{a} \times \mathbf{b} || = || \mathbf{a}|| \ || \mathbf{b}|| \ |sin( \theta)| \tag{1}$$
If we subtract $\mathbf{p_1}$ from $\mathbf{p_2}$, we get a vector stretching along a line, which can be described by the equation $\mathbf{p_1} + t \ ( \mathbf{p_2-p_1})$ where $t \in \mathbb{R}$. Multiplying that vector with the multiplicative inverse of its magnitude,
$$\frac{1}{|| \mathbf{p_2-p_1}||}$$
we get a unit vector, say $\mathbf{ \hat n}$,
$$\mathbf{ \hat n} = \frac{\mathbf{p_2-p_1}}{|| \mathbf{p_2-p_1}||}$$
in the same direction as $\mathbf{p_2-p_1}$. We can also write another vector, $\mathbf{p_0-p_1}$, originating from $\mathbf{p_1}$ to $\mathbf{p_0}$. With $\mathbf{ \hat n}$ and $\mathbf{p_0-p_1}$, using relation $(1)$ we can write,
\begin{align}
|| \mathbf{ \hat n} \times ( \mathbf{p_0-p_1}) || &= || \mathbf{ \hat n}|| \ || \mathbf{p_0-p_1}|| \ |sin( \theta)| \\
&= || \mathbf{p_0-p_1}|| \ |sin( \theta)| \\
&= \frac{|| (\mathbf{p_2-p_1}) \times (\mathbf{p_0-p_1}) ||}{||(\mathbf{p_2-p_1}) ||}
\end{align}
which geometrically corresponds to the perpendicular distance of $\mathbf{p_0}$ to the line. Notice how $\mathbf{ \hat n}$ was written in alternative terms in the equation above.
