title: Check if point is inside circle
body: <p>I have a GPS Coordinate of a spot called <code>spotCoordinates</code> and a center the a circle coordinates <code>this.state.center</code> and a radius in kilometers <code>this.state.radius</code></p>
  
  <p>I'm trying to make a method to check if the <code>spotCoordinates</code> is inside a circle but I don't know how I can add the radius to the coordinates and how to check if it's actually inside or not. It would be easier if it was a square.</p>
  
  <pre><code> calculateParkingSpotsInTheArea = () =&gt; {
        this.state.parkingSpots.map(spot =&gt; {
            let spotCoordinates = spot.coordinates;
            console.log(spotCoordinates, this.state.center, this.state.radius);
            // Calculate if the parking spot is inside the circle
        });
    }
  </code></pre>
  
  <p>E.g Values printed in the console <code>spotCoordinates = [41.5408446218337, -8.612296123028727] center = {lat: 41.536558, lng: -8.627487} radius = 25</code></p>
  
  <p><a href="https://i.stack.imgur.com/WbUkw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WbUkw.png" alt="enter image description here"></a></p>
  
  <p>Any help?</p>