I'm creating an app which displays a map in the form of a basic lat/long grid along with the user's location and heading. I'm currently plotting the grid lines and user location with an equirectangular projection (i.e. simply treating longitude/latitude as x/y coordinates on a rectangular grid) which works fine, but I have a few questions when it comes to plotting the user's heading.
To calculate the current heading, I'm using the formula under the 'Bearing' section of this page. Whenever I get a location update containing a new latitude/longitude, I put it into the formula along with the previous latitude/longitude to find the bearing between them.
However, when I plot my calculated heading arrow on the map, the arrow does not align with the line drawn between the user's current location and their last location, unless you're at the equator. I'm guessing this is because the equirectangular projection distorts a circle into an ellipse as seen here (i.e. it's not conformal).
So, I'm wondering how I might 'transform' the heading value calculated using the above method so that it accounts for this distortion, and the arrow points in the correct direction? I know that one solution would be simply to do atan2(deltaLat, deltaLon) but I'd much prefer to start with a proper heading value and then transform it to a displayable angle depending on which map projection I choose.
Note that the user is not travelling large distances between each location update, so I wouldn't expect to have to worry about the heading changing along a great circle.
Side note: am I right in thinking that if I used a Mercator projection, I could just plot the heading as-is because the distortion does not occur at extreme latitudes?