Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 645 Bytes

README.md

File metadata and controls

16 lines (14 loc) · 645 Bytes

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());