tstCoordinate.cc 457 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "gtest/gtest.h"

#include "radixgeo/coordinate.hh"

using namespace radix;
TEST(Radixgeo, Coordinate)
{
  Coordinate c1(0, -90, 0);
  Coordinate c2(0, -91, 0);
  EXPECT_DOUBLE_EQ(111198.41730306273, c1.distanceTo(c2));
  // Much of this is captured in radixmath::greatCircleDistance

  c1.setAltitude(1);
  EXPECT_EQ(1, c1.altitude());
  c1.setLatitude(20);
  EXPECT_EQ(20, c1.latitude());
  c1.setLongitude(34);
  EXPECT_EQ(34, c1.longitude());
}