title: Check if user is near route checkpoint with GPS
body: <p>Here's the situation:</p>
  
  <p>I have a predetermined GPS route that the user will run. The route has some checkpoints and the user should pass near all of them (think of them as a racing game checkpoint, that prevents the user from taking shortcuts). I need to ensure that the user passes through all the checkpoints. 
  I want to determine an area that will be considered inside a checkpoint's radius, but I don't want it to be just a radial area, it should be an area taking into consideration the form of the path.
  Didn't understand it? Neither did I. Look at this poorly drawn image to understand it better:
  <img src="https://i.stack.imgur.com/pisK0.png" alt="Route example"></p>
  
  <p>The black lines represents the pre-determined path, the blue ball is the checkpoint and the blue polygon is the wanted area. The green line is a more precise user, and the red line is a less accurate user (a drunk guy driving maybe? lol). Both lines should be inside the polygon, but a user who skips totally the route shouldn't.</p>
  
  <p>I already saw somewhere here a function to check is the user is inside a polygon like this, but I need to know how to calculate the polygon.</p>
  
  <p>Any suggestions?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I'm considering using the simple distanceTo() function to just draw an imaginary circle and check if the user is there. That's good because is so much simple to implement and understand, and bad because to make sure the most erronic user passes whithin the checkpoint I would need a big radius, making the correct user enter the checkpoint area sooner than expected.</p>
  
  <p>And just so you guys understand the situation better, this is for an app that is supposed to be used in traffic (car or bus), and the checkpoints should be landmarks or spots that divides your route, for example, somewhere where traffic jam starts or stops.</p>