2

I understand how to get the distance between 2 CLLocations. I need to determine the generalized compass bearing (N, NE, E etc.) from a CLLocation to another CLLocation.

Before I implement something to derive the bearing with the haversine formula is there a generally adapted open source library or code fragment that you've found solves this problem with or without using haversine?

Thanks!

Nick
  • 8,483
  • 10
  • 46
  • 65

2 Answers2

2

I've used some of the snippets available from Movable Type Scripts - both haversine and spherical law of cosines available. The code examples are all in JavaScript, but they translate very easily to C or Objective C.

Claus Broch
  • 9,212
  • 2
  • 29
  • 38
1

Check out https://github.com/100grams/CoreLocationUtils

100grams
  • 3,502
  • 3
  • 30
  • 27