inCircleCheck function

bool inCircleCheck(
  1. double latitude,
  2. double longitude,
  3. double centerLat,
  4. double centerLon,
  5. double radius,
)

Check to see if a point is contained in a circle

Implementation

bool inCircleCheck(double latitude, double longitude, double centerLat,
    double centerLon, double radius) {
  double xDiff = longitude - centerLon;
  double yDiff = latitude - centerLat;

  if (pow(xDiff, 2) + pow(yDiff, 2) <= pow(radius, 2)) {
    return true;
  }

  return false;
}