So we have Latitude and Longitude, putting those together we have a location now. That is simple enough, but once we have a location, we can use that to derive other locations.
Deriving new locations
We create the addDistanceEast(), addDistanceWest(), addDistanceNorth(), and addDistanceSouth() methods to generate a new location-based on our current location. Now, something to note in these methods uses the UnitOfDistance class, to specify the Unit of your distance.
Distance Between locations
You can find the distanceTo() method which takes a GeoLocation, and a UnitOfDistance to return the distance between the two locations.
Discover more from GhostProgrammer - Jeff Miller
Subscribe to get the latest posts sent to your email.