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
Nov 17, 2015

Nov 12, 2015

Nov 11, 2015

Nov 8, 2015

Oct 16, 2015

Oct 9, 2015

Sep 11, 2015

Sep 6, 2015

Aug 26, 2015

Aug 25, 2015

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