I always remember the point-to-line formula in vector-land by thinking
of a point A and line through points B and C. The norm of AB x AC is
twice the area of the triangle ABC. Twice the area of the triangle is
also base times height; base is the norm of BC, and height is what you
want. So the distance is norm(AB x AC) / norm(BC).

I forget what the answer is for the Ax + By + ... = Z form; I should
really look it up. I missed that day in 6th grade or something.

Point-to-ray distance is either the distance to the corresponding
line, or the distance to the endpoint -- depends on whether the point
in question lies on the right "side" of that endpoint.

You'd have to define what you mean by point-to-vector. If you mean
distance to a line segment, it's the same argument as for rays but
with two endpoints to think about.

On Fri, Oct 14, 2011 at 7:42 AM, Lance Norskog <[email protected]> wrote:
> Is there an n-dimensional point-to-line or point-to-vector or point-to-ray
> distance method somewhere?
>
> Is this the easiest to do?
> http://mathforum.org/kb/message.jspa?messageID=1072518&tstart=0
>
> For the truly obsessed: N-dimensional CGI artifacts such as normals,
> bounding boxes, etc.
> http://www.cs.indiana.edu/pub/hanson/Siggraph01QuatCourse/ggndgeom.pdf
>

Reply via email to