I’ve to write a method that has the following signature
public class Position {
double longitude;
double latitude;
}
boolean isInsideTheArea(Position center, double radius, Position point);
So if point is inside the area that has the center as its center and radius as its radius in miles, this should return true, false otherwise.
Use the Haversine formula to compute the distance between
centerandpoint. If that distance is greater thanradius, returnfalse; otherwise returntrue.Pseudocode: