pygame is
Simple DirectMedia Layer is
Site Swing

LinePointDistance - 1.0

John Eriksson (wmjoers)



Simple implementation of a Point to Line distance algorithm. The algorithm also calculates the location of the closest point on the line.

I needed an algorithm like this for one of my projects and coded a small proof of concept that might be helpful for others. The code is not 100% optimized and not documented at all. But I'll think it will be fairly easy to understand.

If you have any improvements of this code please send it to me!!!


Home Page:


click to view original size


LinePointDistance - 1.0 - Jan 4, 2007 account Comments

If you wish to leave a comment with your account, please sign in first.

No user comments have been submitted.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Oct 9, 2015

Sep 11, 2015

Sep 6, 2015

Aug 26, 2015

Aug 25, 2015

Aug 21, 2015

Aug 16, 2015

Jul 30, 2015

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)