Generalizing a distance formula for lines and points in two dimensions A line is defined by $ (x, y) = o + tv $ where o is the point of origin and v is the direction vector, and t is a real number.
I have some point p that might not be on said line, and I want to find the distance to the line. I was thinking I could use the normal of the line, i.e. $ n = (-v_y, v_x) $, to find which multiple then comes out as on the line, i.e. find λ so that $ p + λn = o + tv $, then the distance would be $ ||λn|| $.
So I solve for λ, and get
$$ (p_x + λn_x, p_y + λn_y) = (o_x + tv_x, o_y + tv_y) $$
Two unknowns, two equations -- should work out. Solve for t then λ,
$$ t = (p_x + λn_x - o_x)\frac{1}{v_x} $$
$$ t = (p_y + λn_y - o_y)\frac{1}{v_y} $$
Equality of the two gives
$$ (p_y + λn_y - o_y)v_x = (p_x + λn_x - o_x)v_y $$
$$ \implies (p_y - o_y)v_x - (p_x - o_x)v_y = (λn_x)v_y - (λn_y)v_x $$
$$ \implies λ = \frac{ (p_y - o_y) v_x - (p_x - o_x) v_y }{ n_x v_y - n_y v_x } $$
Since $ n = (-v_y, v_x) $,
$$ λ = - \frac{(p_y - o_y, o_x - p_x)·v}{v·v} $$
This seems a little bit too easy to be true and doesn't seem to work, why not?
Edit: Changed how the normal vector is defined, fixed computation errors
 A: The distance $d(p,L)$ between a point $p$ and a line $L$ is defined to be the minimum of $\|p-x\|$ for $x\in L$. If we use your parameterization of $L$ as $o+tv$, $t\in \mathbb{R}$, then $d(p,L)=\min_{t\in\mathbb{R}} \|o+tv-p\|$. Now, if the minimum occurs at $t_0$, then the minimum of $f(t)=\|o+tv-p\|^2$ also occurs at $t_0$, and vice-versa. 
Let's use calculus to find $t_0$: Our function $f(t)$ can be re-written as 
$$ f(t)= (o_x+tv_x-p_x)^2 + (o_y+tv_y-p_y)^2.$$
Differentiating this and setting the result equal to $0$ gives
$$ 0=2v_x(o_x+tv_x-p_x) + 2v_y(o_y+tv_y-p_y).$$
Then
\begin{align}
0 &= v_x(o_x-p_x) + v_y(o_y-p_y) + (v_x^2+v_y^2)t,
\end{align}
so
$$ t = \frac{v\cdot(p-o)}{\|v\|^2}. $$
Since the second derivative of $f$ is $2(v_x^2+v_y^2)>0$, $f$ must have a local minimum at this $t$. But this $t$ is the only critical point of $f$ on the entire real line, so $f$ must in fact have a global minimum there. Thus, this $t$ must in fact be $t_0$.
Thus, 
\begin{align} 
d(p,L)&=\sqrt{f(t_0)}\\
&=\left\|o-p+\frac{v}{\|v\|}\,\frac{v\cdot(p-o)}{\|v\|}\right\| \\
&=\left\|p-o-\operatorname{proj}_v (p-o)\right\|.
\end{align}
