I have grid showing on a map. I know your location and the location of 2 objects on the map. Objects appear where grid lines cross. Consider the world flat and not round since the area on the map is only a short distance. I want to determine which object is closest to you without using trigonometry and multiplication for performance reasons. I’m not looking for accuracy as much as just getting a ballpark indication. I should be able to determine the shortest distance between the difference in latitude and longitude from my current location. My table, Locations, looks like this:
ID Latitude Longitude
1 50 70
2 30 40
If my location is Latitude = 40 and Longitude = 60, then the location with ID = 1 would be closer to me.
If my location is Latitude = 30 and Longitude = 60, probably both locations are about the same distance, so just pick one.
If my location is latitude = 30 and Longitude = 50, then the location with ID = 2 would be closer.
I would just do a min of the sum of the differences. I tried it out,and it works pretty well.