1

I am trying to find an exact "plug and chug" formula for calculating magnetic declination given time, date, latitude, longitude, elevation, etc. Everywhere I look tells me to use their web based calculator. I was hoping there was a way that I could figure this out myself and maybe code my own calculator.

1 Answers1

2

I don't think an "exact plug and chug" formula exists for this problem.

A free fully documented implementation that does the job is available here:

https://www.ngdc.noaa.gov/geomag/WMM/soft.shtml

It's a substantial piece of software.

You might be able to read the code and the documentation and put together a crude approximation of your own.

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199