Need a quickie algorithm

Started by
1 comment, last by Goodlife 22 years, 6 months ago
Hey all, I need a quickie algorithm-- I had this algorithm in the past, but destroyed my source code at some point. Now I don''t remember how I did it!!! I''m looking for the distance from a point to an infinite line. So, for instance, I''d have a point defined by POINT and a line defined by two POINTs, and I need to get the distance from the point to the line. It doesn''t need to clip at the endpoints or anything-- just the distance from the specified point to the specified line (whose slope and position is defined by two points). Essentially, I need the length of a line segment that is perpendicular to the line, and has one endpoint on the line, and one endpoint at my specified point. Thanks in advance! Goodlife
-- Goodlife-----------------------------Those whom the gods would destroy, they first drive mad.--DirectX design team official motto
Advertisement
http://www.google.com/search?q=%22the+distance+from+a+point+to+a+line%22
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
Hi,
Thanks for the reply. I ended up figuring it out, though.
-- Goodlife-----------------------------Those whom the gods would destroy, they first drive mad.--DirectX design team official motto

This topic is closed to new replies.

Advertisement