pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
LinePointDistance

LinePointDistance - 1.0

John Eriksson (wmjoers)

Tags:

Description

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!!!

Links

Home Page: http://arainyday.se/projects/python/LinePointDistance/
Source: http://arainyday.se/projects/python/LinePointDistance/LinePointDistance.py

Screenshot


click to view original size

Releases

LinePointDistance - 1.0 - Jan 4, 2007

Pygame.org account Comments

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

No user comments have been submitted.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
May 1, 2016

Apr 6, 2016


Mar 27, 2016

Mar 26, 2016

Mar 22, 2016

Mar 19, 2016

Mar 17, 2016

Mar 13, 2016

Feb 27, 2016

Feb 21, 2016

Feb 12, 2016

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