pygame is
Simple DirectMedia Layer is
Site Swing

InCircle - 1.0

Ryan Baumann (theguywhogoton)



I noticed PyGame has no way in checking if a point is inside a circle or any distance function. I then created this, you can just import it (If you download the pyc file and place it in the folder of your game). distance(p1, p2) - Returns an integer check(dis, rad) - Returns a boolean Example:


Home Page:


InCircle - 1.0 - Jan 25, 2009 account Comments

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

June 18, 2009 9:39pm - Ryan Baumann - nickname: (theguywhogoton)
@effeemme: math.hypot...I'm not too sure how that works, I don't believe my distance function would be slower.

@algorias: Yes but there is no way of checking if a point is inside a circle. This could be useful for example checking if a rectangle is inside a circle or any other shape for that matter.
January 25, 2009 11:10am - Vitor Bosshard - nickname: (algorias)
The sprite module already supports collision checks using circles instead of rects.
January 25, 2009 10:23am - Francesco Mastellone - nickname: (effeemme)
Err, how about math.hypot?

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

Oct 22, 2016

Oct 17, 2016

Oct 11, 2016

Oct 10, 2016

Oct 3, 2016

Oct 1, 2016

Sep 19, 2016

Sep 17, 2016

Aug 30, 2016

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