I am looking for a function that will allow me to send 2 Lat, Longs. 1 Lat, long is my base and the second is what I want to determine if it is N,S,E, or West. Or would I have to go NW,N,NE,EN,E,ES,SE,S,SW,WS,W,WN? Either way does anyone have something like this in C#?
Share
First you can calculate the Great Circle Bearing
JavaScript (easily convertable to C#):
http://www.movable-type.co.uk/scripts/latlong.html
Then segment the result into the desired cardinal directions, e.g. if bearing is between -45 (315 degrees) degrees and 45 degrees it is North and so on.