9 #ifndef _LOCATION_TEST_H_
10 #define _LOCATION_TEST_H_
16 #include <cxxtest/TestSuite.h>
31 TS_ASSERT_DELTA(
R2D( bearing ), -38.6611, 0.0002 );
37 double shortDist = 7121.457;
39 TS_ASSERT_DELTA( distance, shortDist, shortDist / 10000 );
40 double medDist( 2280495.4 );
42 TS_ASSERT_DELTA( distance, medDist, medDist / 500 );
43 double longDist( 15654367.0 );
45 TS_ASSERT_DELTA( distance, longDist, longDist / 500 );
51 double shortDist = 7121.457;
53 TS_ASSERT_DELTA( distance, shortDist, shortDist / 10000 );
54 double medDist( 2280495.4 );
56 TS_ASSERT_DELTA( distance, medDist, medDist / 400 );
62 double latitude =
D2R( 36.8 );
63 double longitude =
D2R( -121.8 );
65 TS_ASSERT_DELTA(
R2D( latitude ), 36.85, 0.0001 );
66 TS_ASSERT_DELTA(
R2D( longitude ), -121.85, 0.0001 );
72 double latitude =
D2R( 36.8 );
73 float northingsDelta = 1000;
75 TS_ASSERT_DELTA(
R2D( latitude ), 36.80889, 0.0002 );
80 #endif // _LOCATION_TEST_H
void testGetDistance(void)
Test Location::GetDistance.
Definition: Location_Test.h:35
#define R2D(x)
A macro for converting radians to degrees.
Definition: AuvMath.h:44
#define D2R(x)
A macro for converting degrees to radians.
Definition: AuvMath.h:40
static double GetBearing(const double &latitude0, const double &longitude0, const double &latitude1, const double &longitude1)
Definition: Location.cpp:289
void testNorthingsDelta(void)
Test Location::NorthingsDelta.
Definition: Location_Test.h:70
Contains the AuvMath class declaration.
static double GetDistanceFast(const double &latitude0, const double &longitude0, const double &latitude1, const double &longitude1)
Definition: Location.cpp:328
void testAtBearing(void)
Test Location::AtBearing.
Definition: Location_Test.h:60
Unit tests for Location class.
Definition: Location_Test.h:23
void testGetDistanceFast(void)
Test Location::GetDistanceFast.
Definition: Location_Test.h:49
static double GetDistance(const double &latitude0, const double &longitude0, const double &latitude1, const double &longitude1)
Definition: Location.cpp:320
static double NorthingsDelta(const double startLat, const float northingsDelta)
Definition: Location.cpp:427
static void AtBearing(const float bearing, const float distance, double &lat, double &lon)
Definition: Location.cpp:348
Contains the Location class definition.
void testGetBearing(void)
Test Location::GetBearing.
Definition: Location_Test.h:28