22{
25
27
30
31 try {
32
33 JParser<> zap(
"Auxiliary application to determine tilt angles of seabed based on tripod positions.");
34
37
38 zap(argc, argv);
39 }
40 catch(const exception& error) {
41 FATAL(error.what() << endl);
42 }
43
44 if (tripods.size() < 3) {
45 FATAL(
"Number of tripods " << tripods.size() << endl);
46 }
47
48
49
51
52 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
53 pos += i->getUTMPosition();
54 }
55
56 pos /= tripods.size();
57
59 << showpos <<
FIXED(12,3) << pos.getX() <<
' '
60 << showpos <<
FIXED(12,3) << pos.getY() <<
' '
61 << showpos <<
FIXED(12,3) << pos.getZ() << endl);
62
63
64
66 double Y[3] = { 0.0, 0.0, 0.0 };
67
68 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
69
70 const double x = i->getX() - pos.getX();
71 const double y = i->getY() - pos.getY();
72 const double z = i->getZ() - pos.getZ();
73
74 A.a00 +=
x *
x; A.a01 +=
x *
y; A.a02 +=
x;
75 A.a10 +=
x *
y; A.a11 +=
y *
y; A.a12 +=
y;
76 A.a20 +=
x; A.a21 +=
y; A.a22 += 1.0;
77
80 Y[2] += z;
81 }
82
84
86
87 try {
88
89 A = V.invert();
90
91 const double a = A.a00 * Y[0] + A.a01 * Y[1] + A.a02 * Y[2];
92 const double b = A.a10 * Y[0] + A.a11 * Y[1] + A.a12 * Y[2];
93
94
95
96
97
98
99
100
101
103 const double Ty = b;
104
105 cout << showpos <<
FIXED(12,6) << Tx <<
' '
106 << showpos <<
FIXED(12,6) << Ty << endl;
107 }
108 catch(const exception& error) {
110 }
111
112 return 0;
113}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Singular value decomposition.
Utility class to parse command line options.
Data structure for UTM position.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Auxiliary wrapper for I/O of container with optional comment (see JComment).