Java class to calculate magnetic declination, magnetic field strength, inclination etc. for any point on the earth
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.editorconfig
LICENSE
README.md

README.md

Geomagnetism

Java class to calculate magnetic declination, magnetic field strength, inclination etc. for any point on the earth.

Usage:

// Create instance with only location and without altitude & date
Geomagnetism gm = new Geomagnetism(123.45678, 76.54321);
System.out.printf("Declination: %f\n", gm.getDeclination());

// Create a calendar for calculation
GregorianCalendar calendar = new GregorianCalendar();
calendar.set(2017, 6, 1); // 2017 July 01
// Update instance with altitude and date apart from location
gm.calculate(98.76543, 12.34567, 1234, calendar);
System.out.printf("Declination: %f\n", gm.getDeclination());