Solution (source code)

= Solution

The line has equation $2x-y+2=0$, with normal <vector> $(2,-1)$. The <distance from a point to a line> is the <absolute value> of the normal component of the displacement:
$$
\boxed{d=\frac{|2(4)-(-6)+2|}{\sqrt{2^2+(-1)^2}}=\frac{16}{\sqrt5}.}
$$
The perpendicular foot is $(4,-6)-(16/5)(2,-1)=(-12/5,-14/5)$, which lies on the line and realizes this shortest distance.