Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Need a quickie algorithm

This topic is 6062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!