2 ms·
There's also the trick way to do it, namely the distance from (x0,y0) to the line ax+by+c=0 is |ax0+by0+c|/sqrt(a^2+b^2) This has the advantage that it general
by jibiki 18y ago
There's also the trick way to do it, namely the distance from (x0,y0) to the line ax+by+c=0 is |ax0+by0+c|/sqrt(a^2+b^2)
This has the advantage that it generalizes to arbitrary dimensions. For example, you can do it to find the distance from a point to a plane (|ax0+by0+cz0+d|/sqrt(a^2+b^2+c^2)). The math behind it is pretty much the same, except you're projecting onto a normal instead of onto the line itself.