#pragma once
#include <AP_Common/Location.h>
class AP_Declination
{
public:
static bool get_mag_field_ef(float latitude_deg, float longitude_deg, float &intensity_gauss, float &declination_deg, float &inclination_deg);
static Vector3f get_earth_field_ga(const Location &loc);
static float get_declination(float latitude_deg, float longitude_deg);
private:
static const float SAMPLING_RES;
static const float SAMPLING_MIN_LAT;
static const float SAMPLING_MAX_LAT;
static const float SAMPLING_MIN_LON;
static const float SAMPLING_MAX_LON;
static const uint32_t LAT_TABLE_SIZE = 19;
static const uint32_t LON_TABLE_SIZE = 37;
static const float declination_table[LAT_TABLE_SIZE][LON_TABLE_SIZE];
static const float inclination_table[LAT_TABLE_SIZE][LON_TABLE_SIZE];
static const float intensity_table[LAT_TABLE_SIZE][LON_TABLE_SIZE];
};