title: How can I figure out whether a region belongs to a shape or not?
body: <p>I am trying to write a program which draws circles and connects them using lines (I'm still learning the language) and I would like to perform a check on the mouse coordinates whenever I click on the screen. This check should be able to tell me whether the mouse is inside a particular shape or not.</p>
  
  <p>I am aware that I can (of course) build some if instructions to define a rectangle and check if the mouse is inside the rectangle or not, but I can't figure out how to do this with any shape, so my question is: </p>
  
  <p><strong>Is it possible to write a function able to tell me if the mouse pointer (or any other point in the plane) is within a particular region regardless of its shape?</strong></p>
  
  <p>Another use would be, for example, checking whether a line I'm drawing crosses a circle which is already on the plane.</p>