Search code examples
cocoa-touchgpscore-location

Ia there a way to get or calculate true north in cocoa touch?


I am would like to determine a direction moving x degrees clockwise starting on true north. Is there a way for me get or calculate true north based on a set of lat & long coordinates?

I am interested in implementing this cocoa touch. I am sure this is used in many of the applications already out there. Any comments, pointers, advice will be highly appreciated.

Thanks

ldj


Solution

  • Zekian is on the right path, though... It looks like you need your current long/lat, and the current magnetic poles long/lat, a bit of spherical geometry to figure out the magnetic derivation ("declination" is a word that pops up a lot), and then apply that derivation to your current magnetic north reading. And because the earth's magnetic field keeps moving around, you need to compensate for this too. Or atleast offer an update for the magnetic north's long/lat.

    These are links I found along the way, but my head started spinning like in the Exorcist before I could come up with anything clever

    http://www.nauticalissues.com/en/math1.html

    Link

    Link

    http://www.ngdc.noaa.gov/geomag/magfield.shtml

    http://en.wikipedia.org/wiki/Magnetic_declination