Earlier this week I wrote about how to calculate the distance between two points in a location-aware app. Today, I am going to discuss a related topic: how to calculate the bearing between two points.
If you are developing a location-aware application, you may reach a point where you need to know the distance between two geographic locations, such as the user's current position and some destination point like a city, airport, or attraction. The Location API in Windows 8 and the LocationManager class in Android, however, report positions in latitude and longitude as do most global services that map geographic names to a position on the earth.
The Windows Sensor and Location platform, first introduced by Microsoft back in Windows 7, allows applications to obtain information about, and react to, the hardware's physical environment. One of the many sensor types that are supported are those that provide location information, including GPS receivers.
You can use the Window Runtime Geolocation API in developing location-aware Metro Style apps, for example, attaching geo-location information to photos, searching for local Points of Interests, plotting the hiking routes in an outdoors fitness app etc. This blog describes some aspects we found out while using the WinRT Geolocation API.