I have a list of locations , following this pattern:
[1] = {lat = -40.2452, longitude = -76.2489},
[2] = {lat = -40.2452, longitude = -76.2489},
[3] = {lat = -40.2452, longitude = -76.2489},
[4] = {lat = -40.2452, longitude = -76.2489}
and a localition
location = {lat = -40.2452, longitude = -76.2489}
and I want to calculate Which of the locations this Within the distance.
I found a formula that calculates the distance between two points.
but if this list is big!
is there any faster way?
or you can go through the list in a loop ?
FOR LOCATION IN LISTLOCATION DO
IF GETDISTANCE(LOCATION, LOCATION2) <= DISTANCE
SAVE THIS LOCATION
END
END
These values are a example