[SOLVED] Obtaining Magnetic Declination

Why not just find out what the magnetic declination is for your area and adjust for it in your code? For example: my location in Ohio is 8 degrees 15 minutes west of grid or true north so I would just add 8 to my azimuth to find grid north. Depending you exact your direction needs to be, you could use decimals. Don't forget to convert minutes to a decimal. multiply by 1/60

This will use your ip address to give your magnetic declination: