title: Check if a latitude and longitude is within a circle google maps
body: <p><strong>Below is the desired result, which I'm looking for</strong></p>
  
  <p><img src="https://i.stack.imgur.com/U1c9F.png" alt="enter image description here"></p>
  
  <p><strong>What I would like to know is:</strong></p>
  
  <p>I have created the circle using center point lat lang and radius around it. Now I want to know, how to check (calculate) if a latitude and longitude is either inside or outside the area I would appreciate if you can give me code example in Javascript. I'm using Google Maps API V3.</p>
  
  <p><strong>I found this function but not working as expected for me:</strong></p>
  
  <pre><code>function arePointsNear(checkPoint, centerPoint) {
      var sw = new google.maps.LatLng(centerPoint.lat() - 0.005, centerPoint.lng() - 0.005);
      var ne = new google.maps.LatLng(centerPoint.lat() + 0.005, centerPoint.lng() + 0.005);
      var bounds = new google.maps.LatLngBounds(sw, ne);
      if (bounds.contains (checkPoint)){
          return true;
      }
      return false;
  }
  </code></pre>
  
  <p>Any help will be great.. thanks in advance!!</p>