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
Feb 12, 2016

Feb 7, 2016

Feb 4, 2016

Jan 30, 2016

Jan 24, 2016

Jan 23, 2016

Jan 18, 2016

Jan 5, 2016

Dec 27, 2015

Dec 12, 2015

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