## Closest point on a 3d-Line to a point in 3d-space

### Closest point on a 3d-Line to a point in 3d-space

I've seen the comp.graphics.algorithm FAQs on how to get the shortest
distance from a point to a line, but that method applies to 2d space. Could
anyone assist me in obtaining an algorithm that works in 3d space?

Thank you,
John Balestrieri

### Closest point on a 3d-Line to a point in 3d-space

>I've seen the comp.graphics.algorithm FAQs on how to get the shortest
>distance from a point to a line, but that method applies to 2d space. Could
>anyone assist me in obtaining an algorithm that works in 3d space?

http://www.cs.unc.edu/~eberly/gr_dist.htm

--
Dave Eberly

http://www.magic-software.com

just wondering if anyone had any quick way of finding out a point on a
line segment that lies closest to a separate point in 3d space (and also
a method for 2d space)? i'm having to do it with integers, and it's part
of an inner loop, so i don't want to mess around with normalising vectors
etc if possible. i realise that it would be possible to find the closest
point on the infinite line on which the line segment lies, and then test
whether it sits inside the line segment, but that's probably a bit too
expensive.

Mike (:

4. Shellac