10 #include <utl/CoordinateSystem.h>
11 #include <utl/Vector.h>
12 #include <utl/TransformationMatrix.h>
13 #include <utl/AugerUnits.h>
14 #include <tst/Verify.h>
15 #include <utl/Triple.h>
17 #include <cppunit/extensions/HelperMacros.h>
29 CPPUNIT_TEST(testVectorTransformation);
30 CPPUNIT_TEST(testVectorOperations);
31 CPPUNIT_TEST_SUITE_END();
47 p.TransformTo(CTrans);
49 CPPUNIT_ASSERT(Verify<CloseTo>(
50 p.GetCoordinates(CTrans),
Triple(0,0,0)));
52 CPPUNIT_ASSERT(Verify<CloseTo>(
53 p.GetCoordinates(CS),
Triple(0,0,0)));
56 const Vector horizontal(1,0,0, CS);
58 horizontal.TransformTo(CRot);
59 CPPUNIT_ASSERT(horizontal.GetCoordinateSystem() == CRot);
60 CPPUNIT_ASSERT(Verify<CloseTo>(
61 horizontal.GetCoordinates(CRot),
Triple(0,-1,0)));
62 CPPUNIT_ASSERT(horizontal.GetCoordinateSystem() == CRot);
63 CPPUNIT_ASSERT(Verify<CloseTo>(
64 horizontal.GetCoordinates(CS),
Triple(1,0,0)));
65 CPPUNIT_ASSERT(horizontal.GetCoordinateSystem() == CS);
74 const Vector v1(1,2,3, CS);
77 CPPUNIT_ASSERT(Verify<CloseTo>(
78 v2.GetCoordinates(CS),
Triple(2,0,-2)));
81 CPPUNIT_ASSERT(Verify<CloseTo>(
82 v2.GetCoordinates(CS),
Triple(3,-1,1)));
85 CPPUNIT_ASSERT(Verify<CloseTo>(
86 v3.GetCoordinates(CS),
Triple(-3,1,-1)));
CoordinateSystemPtr GetCoordinateSystem() const
Get the coordinate system of the current internal representation.
void testVectorTransformation()
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
void testVectorOperations()
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
boost::tuple< double, double, double > Triple
Coordinate triple for easy getting or setting of coordinates.