title: determine if a point sits inside an arbitrary shape?
body: <p>Given a point's coordinates, how can I determine if it is within an arbitrary shape?</p>
  
  <p>The shape is defined by an array of points, I do not know where the shape is 'closed', the part I really need help is to work out where the shape is closed.</p>
  
  <p>Here's an image to illustrate what I mean a little better:</p>
  
  <p><img src="https://i.stack.imgur.com/3y3VX.jpg" alt="enter image description here"></p>