AP_Declination: fixed usage of headers

This commit is contained in:
Andrew Tridgell 2012-03-11 20:53:22 +11:00
parent b9be6ed290
commit c1b945018b
2 changed files with 13 additions and 9 deletions

View File

@ -1,6 +1,4 @@
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "AP_Declination.h"
/*
* Adam M Rivera
* With direction from: Andrew Tridgell, Jason Short, Justin Beech
@ -9,8 +7,19 @@
* Scott Ferguson
* scottfromscott@gmail.com
*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.
*/
#include <FastSerial.h>
#include <AP_Common.h>
#include <AP_Declination.h>
#include <avr/pgmspace.h>
#include <math.h>
static const int8_t dec_tbl[37][73] PROGMEM = \
{{150,145,140,135,130,125,120,115,110,105,100,95,90,85,80,75,70,65,60,55,50,45,40,35,30,25,20,15,10,5,0,-4,-9,-14,-19,-24,-29,-34,-39,-44,-49,-54,-59,-64,-69,-74,-79,-84,-89,-94,-99,104,109,114,119,124,129,134,139,144,149,154,159,164,169,174,179,175,170,165,160,155,150}, \
{143,137,131,126,120,115,110,105,100,95,90,85,80,75,71,66,62,57,53,48,44,39,35,31,27,22,18,14,9,5,1,-3,-7,-11,-16,-20,-25,-29,-34,-38,-43,-47,-52,-57,-61,-66,-71,-76,-81,-86,-91,-96,101,107,112,117,123,128,134,140,146,151,157,163,169,175,178,172,166,160,154,148,143}, \
@ -76,4 +85,4 @@ AP_Declination::get_declination(float lat, float lon)
decmin = (lon - lonmin) / 5 * (decSE - decSW) + decSW;
decmax = (lon - lonmin) / 5 * (decNE - decNW) + decNW;
return (lat - latmin) / 5 * (decmax - decmin) + decmin;
}
}

View File

@ -3,11 +3,6 @@
#ifndef AP_Declination_h
#define AP_Declination_h
// Just incase it wasn't included elsewhere
#include <avr/pgmspace.h>
#include <math.h>
#include "../AP_Common/AP_Common.h"
/*
* Adam M Rivera
* With direction from: Andrew Tridgell, Jason Short, Justin Beech
@ -23,4 +18,4 @@ public:
static float get_declination(float lat, float lon);
};
#endif
#endif // AP_Declination_h