View Single Post
  #2 (permalink)  
Old 07-03-2008, 01:12 AM
Norm's Avatar
Norm Norm is offline
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
Norm is on a distinguished road
Write a class for the circle (x,y,r). Add a method contains() that takes a point (x,Y) and computes if that point is in the circle.
The logic would be a bit of trig. Or use Pythagorian's rule to see if the distance from the center to the point is less than the radius.
Make a list of all the circles and call each circle to see which one contains the point.
Reply With Quote