My objective is to analyze multiple sets of location data (latitude, longitude) in order to determine the farthest two locations from the group. While I am familiar with calculating the distance between two locations, I am seeking guidance on how to approach this when dealing with multiple locations.
function FarthestDistance(points) {
// This function is designed to compare all objects within 'points' to identify the two locations with the greatest distance between them
// It should recursively determine the distance between each point and return the two farthest points
}
var obj = {{lat1,lon1},{lat2,lon2},{lat3,lon3},{lat4,lon4}};
FarthestDistance(obj);
Hopefully, the explanation is now clear. Thank you.