Main MRPT website > C++ reference for MRPT 1.9.9
test.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include <mrpt/system/os.h>
11 #include <mrpt/topography.h>
12 #include <mrpt/math/CMatrixD.h>
13 #include <iomanip>
14 #include <iostream>
15 
16 using namespace mrpt::math;
17 using namespace mrpt::topography;
18 using namespace mrpt::system;
19 using namespace std;
20 
21 #include <mrpt/examples_config.h>
22 
23 std::vector<string> names;
24 std::vector<CMatrixD> results;
25 const double TH = 0.02;
26 
27 void exampleResults()
28 {
29  names.resize(6);
30  names[0] = "MAND";
31  names[1] = "OROZ";
32  names[2] = "SANC";
33  names[3] = "ARJO";
34  names[4] = "CANI";
35  names[5] = "HALC";
36  results.resize(25);
37 
38  // Example 01
39  results[0] = CMatrixD(6, 3);
40  results[0].set_unsafe(0, 0, 435699.5503);
41  results[0].set_unsafe(0, 1, 4194142.0571);
42  results[0].set_unsafe(0, 2, 515.5790);
43  results[0].set_unsafe(1, 0, 443948.2295);
44  results[0].set_unsafe(1, 1, 4160754.7114);
45  results[0].set_unsafe(1, 2, 1489.1880);
46  results[0].set_unsafe(2, 0, 436542.0710);
47  results[0].set_unsafe(2, 1, 4177367.6694);
48  results[0].set_unsafe(2, 2, 1054.1890);
49  results[0].set_unsafe(3, 0, 406284.9288);
50  results[0].set_unsafe(3, 1, 4176492.3033);
51  results[0].set_unsafe(3, 2, 569.1820);
52  results[0].set_unsafe(4, 0, 406546.3268);
53  results[0].set_unsafe(4, 1, 4156628.3641);
54  results[0].set_unsafe(4, 2, 897.6260);
55  results[0].set_unsafe(5, 0, 408051.6599);
56  results[0].set_unsafe(5, 1, 4193733.3066);
57  results[0].set_unsafe(5, 2, 530.4460);
58 
59  // Example 02
60  results[1] = CMatrixD(6, 3);
61  results[1].set_unsafe(0, 0, 435810.797);
62  results[1].set_unsafe(0, 1, 4194348.753);
63  results[1].set_unsafe(0, 2, 437.516);
64  results[1].set_unsafe(1, 0, 444059.747);
65  results[1].set_unsafe(1, 1, 4160961.358);
66  results[1].set_unsafe(1, 2, 1410.518);
67  results[1].set_unsafe(2, 0, 436653.444);
68  results[1].set_unsafe(2, 1, 4177574.314);
69  results[1].set_unsafe(2, 2, 975.764);
70  results[1].set_unsafe(3, 0, 406396.235);
71  results[1].set_unsafe(3, 1, 4176698.718);
72  results[1].set_unsafe(3, 2, 490.219);
73  results[1].set_unsafe(4, 0, 406657.783);
74  results[1].set_unsafe(4, 1, 4156834.717);
75  results[1].set_unsafe(4, 2, 818.224);
76  results[1].set_unsafe(5, 0, 408162.836);
77  results[1].set_unsafe(5, 1, 4193939.783);
78  results[1].set_unsafe(5, 2, 451.896);
79 
80  // Example 03
81  results[2] = CMatrixD(6, 3);
82  results[2].set_unsafe(0, 0, 435811.252);
83  results[2].set_unsafe(0, 1, 4194347.983);
84  results[2].set_unsafe(0, 2, 515.579);
85  results[2].set_unsafe(1, 0, 444059.929);
86  results[2].set_unsafe(1, 1, 4160960.606);
87  results[2].set_unsafe(1, 2, 1489.188);
88  results[2].set_unsafe(2, 0, 436653.768);
89  results[2].set_unsafe(2, 1, 4177573.581);
90  results[2].set_unsafe(2, 2, 1054.189);
91  results[2].set_unsafe(3, 0, 406396.600);
92  results[2].set_unsafe(3, 1, 4176698.222);
93  results[2].set_unsafe(3, 2, 569.182);
94  results[2].set_unsafe(4, 0, 406657.992);
95  results[2].set_unsafe(4, 1, 4156834.266);
96  results[2].set_unsafe(4, 2, 897.626);
97  results[2].set_unsafe(5, 0, 408163.337);
98  results[2].set_unsafe(5, 1, 4193939.241);
99  results[2].set_unsafe(5, 2, 530.446);
100 
101  // Example 04
102  results[3] = CMatrixD(6, 3);
103  results[3].set_unsafe(0, 0, 435811.073);
104  results[3].set_unsafe(0, 1, 4194347.990);
105  results[3].set_unsafe(0, 2, 466.175);
106  results[3].set_unsafe(1, 0, 444059.962);
107  results[3].set_unsafe(1, 1, 4160960.412);
108  results[3].set_unsafe(1, 2, 1439.784);
109  results[3].set_unsafe(2, 0, 436653.708);
110  results[3].set_unsafe(2, 1, 4177573.506);
111  results[3].set_unsafe(2, 2, 1004.785);
112  results[3].set_unsafe(3, 0, 406396.665);
113  results[3].set_unsafe(3, 1, 4176698.318);
114  results[3].set_unsafe(3, 2, 519.778);
115  results[3].set_unsafe(4, 0, 406658.202);
116  results[3].set_unsafe(4, 1, 4156834.269);
117  results[3].set_unsafe(4, 2, 848.222);
118  results[3].set_unsafe(5, 0, 408163.269);
119  results[3].set_unsafe(5, 1, 4193939.405);
120  results[3].set_unsafe(5, 2, 481.042);
121 
122  // Example 05
123  results[4] = CMatrixD(6, 3);
124  results[4].set_unsafe(0, 0, 435811.251);
125  results[4].set_unsafe(0, 1, 4194347.974);
126  results[4].set_unsafe(0, 2, 465.655);
127  results[4].set_unsafe(1, 0, 444059.934);
128  results[4].set_unsafe(1, 1, 4160960.612);
129  results[4].set_unsafe(1, 2, 1439.740);
130  results[4].set_unsafe(2, 0, 436653.771);
131  results[4].set_unsafe(2, 1, 4177573.582);
132  results[4].set_unsafe(2, 2, 1004.556);
133  results[4].set_unsafe(3, 0, 406396.596);
134  results[4].set_unsafe(3, 1, 4176698.222);
135  results[4].set_unsafe(3, 2, 520.037);
136  results[4].set_unsafe(4, 0, 406657.988);
137  results[4].set_unsafe(4, 1, 4156834.272);
138  results[4].set_unsafe(4, 2, 848.836);
139  results[4].set_unsafe(5, 0, 408163.337);
140  results[4].set_unsafe(5, 1, 4193939.239);
141  results[4].set_unsafe(5, 2, 480.961);
142 
143  // Example 06
144  results[5] = CMatrixD(6, 3);
145  results[5].set_unsafe(0, 0, 435811.250);
146  results[5].set_unsafe(0, 1, 4194347.994);
147  results[5].set_unsafe(0, 2, 437.516);
148  results[5].set_unsafe(1, 0, 444059.921);
149  results[5].set_unsafe(1, 1, 4160960.599);
150  results[5].set_unsafe(1, 2, 1410.518);
151  results[5].set_unsafe(2, 0, 436653.764);
152  results[5].set_unsafe(2, 1, 4177573.581);
153  results[5].set_unsafe(2, 2, 975.764);
154  results[5].set_unsafe(3, 0, 406396.606);
155  results[5].set_unsafe(3, 1, 4176698.225);
156  results[5].set_unsafe(3, 2, 490.219);
157  results[5].set_unsafe(4, 0, 406657.997);
158  results[5].set_unsafe(4, 1, 4156834.260);
159  results[5].set_unsafe(4, 2, 818.224);
160  results[5].set_unsafe(5, 0, 408163.340);
161  results[5].set_unsafe(5, 1, 4193939.242);
162  results[5].set_unsafe(5, 2, 451.896);
163 
164  // Example 07
165  results[6] = CMatrixD(6, 3);
166  results[6].set_unsafe(0, 0, 435811.074);
167  results[6].set_unsafe(0, 1, 4194347.994);
168  results[6].set_unsafe(0, 2, 466.791);
169  results[6].set_unsafe(1, 0, 444059.961);
170  results[6].set_unsafe(1, 1, 4160960.410);
171  results[6].set_unsafe(1, 2, 1439.793);
172  results[6].set_unsafe(2, 0, 436653.708);
173  results[6].set_unsafe(2, 1, 4177573.505);
174  results[6].set_unsafe(2, 2, 1005.039);
175  results[6].set_unsafe(3, 0, 406396.667);
176  results[6].set_unsafe(3, 1, 4176698.320);
177  results[6].set_unsafe(3, 2, 519.494);
178  results[6].set_unsafe(4, 0, 406658.203);
179  results[6].set_unsafe(4, 1, 4156834.270);
180  results[6].set_unsafe(4, 2, 847.499);
181  results[6].set_unsafe(5, 0, 408163.267);
182  results[6].set_unsafe(5, 1, 4193939.401);
183  results[6].set_unsafe(5, 2, 481.171);
184 
185  // Example 08
186  results[7] = CMatrixD(6, 3);
187  results[7].set_unsafe(0, 0, 435811.250);
188  results[7].set_unsafe(0, 1, 4194347.974);
189  results[7].set_unsafe(0, 2, 465.657);
190  results[7].set_unsafe(1, 0, 444059.935);
191  results[7].set_unsafe(1, 1, 4160960.612);
192  results[7].set_unsafe(1, 2, 1439.739);
193  results[7].set_unsafe(2, 0, 436653.772);
194  results[7].set_unsafe(2, 1, 4177573.582);
195  results[7].set_unsafe(2, 2, 1004.556);
196  results[7].set_unsafe(3, 0, 406396.597);
197  results[7].set_unsafe(3, 1, 4176698.223);
198  results[7].set_unsafe(3, 2, 520.037);
199  results[7].set_unsafe(4, 0, 406657.988);
200  results[7].set_unsafe(4, 1, 4156834.271);
201  results[7].set_unsafe(4, 2, 848.837);
202  results[7].set_unsafe(5, 0, 408163.339);
203  results[7].set_unsafe(5, 1, 4193939.239);
204  results[7].set_unsafe(5, 2, 480.959);
205 
206  // Example 10
207  results[9] = CMatrixD(6, 3);
208  results[9].set_unsafe(0, 0, 435811.2512);
209  results[9].set_unsafe(0, 1, 4194347.9756);
210  results[9].set_unsafe(0, 2, 465.6558);
211  results[9].set_unsafe(1, 0, 444059.9337);
212  results[9].set_unsafe(1, 1, 4160960.6109);
213  results[9].set_unsafe(1, 2, 1439.7390);
214  results[9].set_unsafe(2, 0, 436653.7721);
215  results[9].set_unsafe(2, 1, 4177573.5812);
216  results[9].set_unsafe(2, 2, 1004.5560);
217  results[9].set_unsafe(3, 0, 406396.5970);
218  results[9].set_unsafe(3, 1, 4176698.2216);
219  results[9].set_unsafe(3, 2, 520.0376);
220  results[9].set_unsafe(4, 0, 406657.9894);
221  results[9].set_unsafe(4, 1, 4156834.2734);
222  results[9].set_unsafe(4, 2, 848.8373);
223  results[9].set_unsafe(5, 0, 408163.3366);
224  results[9].set_unsafe(5, 1, 4193939.2373);
225  results[9].set_unsafe(5, 2, 480.9593);
226 
227  // Example 11
228  results[10] = CMatrixD(6, 3);
229  results[10].set_unsafe(0, 0, 435811.2512);
230  results[10].set_unsafe(0, 1, 4194347.9756);
231  results[10].set_unsafe(0, 2, 465.6558);
232  results[10].set_unsafe(1, 0, 444059.9337);
233  results[10].set_unsafe(1, 1, 4160960.6109);
234  results[10].set_unsafe(1, 2, 1439.7390);
235  results[10].set_unsafe(2, 0, 436653.7721);
236  results[10].set_unsafe(2, 1, 4177573.5812);
237  results[10].set_unsafe(2, 2, 1004.5560);
238  results[10].set_unsafe(3, 0, 406396.5970);
239  results[10].set_unsafe(3, 1, 4176698.2216);
240  results[10].set_unsafe(3, 2, 520.0376);
241  results[10].set_unsafe(4, 0, 406657.9894);
242  results[10].set_unsafe(4, 1, 4156834.2734);
243  results[10].set_unsafe(4, 2, 848.8373);
244  results[10].set_unsafe(5, 0, 408163.3366);
245  results[10].set_unsafe(5, 1, 4193939.2373);
246  results[10].set_unsafe(5, 2, 480.9593);
247 
248  // Example 12
249  results[11] = CMatrixD(6, 3);
250  results[11].set_unsafe(0, 0, 435811.156);
251  results[11].set_unsafe(0, 1, 4194347.892);
252  results[11].set_unsafe(0, 2, 466.100);
253  results[11].set_unsafe(1, 0, 444059.719);
254  results[11].set_unsafe(1, 1, 4160960.489);
255  results[11].set_unsafe(1, 2, 1439.389);
256  results[11].set_unsafe(2, 0, 436653.606);
257  results[11].set_unsafe(2, 1, 4177573.398);
258  results[11].set_unsafe(2, 2, 1004.594);
259  results[11].set_unsafe(3, 0, 406396.045);
260  results[11].set_unsafe(3, 1, 4176697.926);
261  results[11].set_unsafe(3, 2, 520.238);
262  results[11].set_unsafe(4, 0, 406658.812);
263  results[11].set_unsafe(4, 1, 4156834.183);
264  results[11].set_unsafe(4, 2, 849.050);
265  results[11].set_unsafe(5, 0, 408163.542);
266  results[11].set_unsafe(5, 1, 4193940.012);
267  results[11].set_unsafe(5, 2, 480.414);
268 
269  // Example 13
270  results[12] = CMatrixD(6, 3);
271  results[12].set_unsafe(0, 0, 435811.095);
272  results[12].set_unsafe(0, 1, 4194348.146);
273  results[12].set_unsafe(0, 2, 465.884);
274  results[12].set_unsafe(1, 0, 444059.906);
275  results[12].set_unsafe(1, 1, 4160960.276);
276  results[12].set_unsafe(1, 2, 1439.564);
277  results[12].set_unsafe(2, 0, 436653.748);
278  results[12].set_unsafe(2, 1, 4177573.521);
279  results[12].set_unsafe(2, 2, 1004.572);
280  results[12].set_unsafe(3, 0, 406396.375);
281  results[12].set_unsafe(3, 1, 4176698.033);
282  results[12].set_unsafe(3, 2, 520.147);
283  results[12].set_unsafe(4, 0, 406658.370);
284  results[12].set_unsafe(4, 1, 4156834.517);
285  results[12].set_unsafe(4, 2, 848.945);
286  results[12].set_unsafe(5, 0, 408163.386);
287  results[12].set_unsafe(5, 1, 4193939.406);
288  results[12].set_unsafe(5, 2, 480.674);
289 }
290 
291 void displayResults(
292  const CVectorDouble& thisResults, const unsigned int& example,
293  const bool color)
294 {
295  cout << "Example " << example << ". Results" << setprecision(16) << endl;
296  cout << "------------------------------------------------------------------"
297  "----------"
298  << endl;
299  cout << "N\t"
300  << "X\t\t\t"
301  << "Y\t\t\t"
302  << "Z" << endl;
303  cout << "------------------------------------------------------------------"
304  "----------"
305  << endl;
306 
307  if (color)
308  {
309  const size_t N = thisResults.size() / 3;
310  for (unsigned int i = 0; i < N; ++i)
311  {
312  cout << names[i] << "\t";
313  if (fabs(
314  thisResults[3 * i + 0] -
315  results[example - 1].get_unsafe(i, 0)) < TH)
317  else
319  cout << thisResults[3 * i + 0] << "\t";
320 
321  if (fabs(
322  thisResults[3 * i + 1] -
323  results[example - 1].get_unsafe(i, 1)) < TH)
325  else
327  cout << thisResults[3 * i + 1] << "\t";
328 
329  if (fabs(
330  thisResults[3 * i + 2] -
331  results[example - 1].get_unsafe(i, 2)) < TH)
333  else
335  cout << thisResults[3 * i + 2] << endl;
337  }
338  cout << endl;
339  }
340  else
341  {
342  const size_t N = thisResults.size() / 3;
343  for (unsigned int i = 0; i < N; ++i)
344  cout << names[i] << "\t" << thisResults[3 * i + 0] << "\t"
345  << thisResults[3 * i + 1] << "\t" << thisResults[3 * i + 2]
346  << endl;
347  cout << endl;
348  }
349 }
350 
352 {
353  // Initial UTM coordinates (X,Y,Z)
354  mrpt::math::TPoint3D UTMCoords;
355  UTMCoords.x = 435500;
356  UTMCoords.y = 4194142.057;
357  UTMCoords.z = 515.579;
358 
359  const int huso = 30;
360  const char hem = 'n';
361 
362  TGeodeticCoords GeodeticCoords;
363  TEllipsoid ellip = TEllipsoid::Ellipsoid_WGS84();
364 
365  // Dump to console of input values
366  cout << "INPUT DATA: " << endl
367  << "----------------------------------" << endl;
368  cout << "UTM Coordinates: " << endl;
369  cout << "X = " << setprecision(15) << UTMCoords.x << endl;
370  cout << "Y = " << UTMCoords.y << endl;
371  cout << "Z = " << UTMCoords.z << endl;
372  cout << "Time zone: " << huso << endl;
373  cout << "Hemisphery: " << hem << endl;
374  cout << "Ellipsoid: " << ellip.name << endl;
375  cout << "----------------------------------" << endl << endl;
376 
377  // UTM to Geodetic ...
378  UTMToGeodetic(UTMCoords, huso, hem, GeodeticCoords, ellip);
379  cout << "UTM to Geodetic" << endl;
380  cout << "Geodetic Coordinates:" << endl;
381  cout << "Lon = " << TCoords(GeodeticCoords.lon) << " ["
382  << GeodeticCoords.lon << "]" << endl;
383  cout << "Lat = " << TCoords(GeodeticCoords.lat) << " ["
384  << GeodeticCoords.lon << "]" << endl;
385  cout << "H = " << GeodeticCoords.height << endl;
386  cout << "----------------------------------" << endl;
387 
388  // Geodetic to Geocentric ...
389  TGeocentricCoords GeocentricCoords;
390  geodeticToGeocentric(GeodeticCoords, GeocentricCoords, ellip);
391  cout << "Geodetic to Geocentric" << endl;
392  cout << "Geocentric Coordinates:" << endl;
393  cout << "X = " << GeocentricCoords.x << endl;
394  cout << "Y = " << GeocentricCoords.y << endl;
395  cout << "Z = " << GeocentricCoords.z << endl;
396  cout << "----------------------------------" << endl;
397 
398  // 7 parameter transformation (X,Y,Z) -> (X',Y',Z')
399  // TDatum7Params datum( dx, dy, dz, rx(sec), ry(sec), rz(sec), ds(ppm) );
400  TDatum7Params datum(
401  109.4714, 106.7407, 141.7916, 4.7834, 7.9668, -5.3771, -6.690000);
402  TGeocentricCoords GeocentricCoords2;
403  transform7params(GeocentricCoords, datum, GeocentricCoords2);
404  // transform7params(
405  // TGeocentricCoords(5029475.945,-328201.0396,3896351.728), datum,
406  // GeocentricCoords2 );
407  cout << "transform7params" << endl;
408  cout << "Transformed Geocentric Coordinates:" << endl;
409  cout << "X = " << GeocentricCoords2.x << endl;
410  cout << "Y = " << GeocentricCoords2.y << endl;
411  cout << "Z = " << GeocentricCoords2.z << endl;
412  cout << "----------------------------------" << endl;
413 
414  // ... and back to Geodetic
415  TGeodeticCoords GeodeticCoords2;
416  ellip = TEllipsoid::Ellipsoid_Hough_1960();
417  geocentricToGeodetic(GeocentricCoords2, GeodeticCoords2, ellip);
418  cout << "Geocentric to Geodetic" << endl;
419  cout << "Geodetic Coordinates:" << endl;
420  cout << "Lon = " << TCoords(GeodeticCoords2.lon) << " ["
421  << GeodeticCoords2.lon << "]" << endl;
422  cout << "Lat = " << TCoords(GeodeticCoords2.lat) << " ["
423  << GeodeticCoords2.lat << "]" << endl;
424  cout << "H = " << GeodeticCoords2.height << endl;
425  cout << "----------------------------------" << endl;
426 
427  // ... and back to UTM
428  TUTMCoords UTMCoords2;
429  int time_zone2;
430  char latitude_band2;
431  // geodeticToUTM( GeodeticCoords2, UTMCoords2, time_zone2, latitude_band2,
432  // ellip );
434  TGeodeticCoords(37.89604181, -3.72987289, 542.8624741), UTMCoords2,
435  time_zone2, latitude_band2, TEllipsoid(6378270, 6356794.343, "USER"));
436  cout << "Geodetic to UTM" << endl;
437  cout << "UTM Coordinates:" << endl;
438  cout << "X = " << UTMCoords2.x << endl;
439  cout << "Y = " << UTMCoords2.y << endl;
440  cout << "Z = " << UTMCoords2.z << endl;
441  cout << "Time zone: " << time_zone2 << endl;
442  cout << "----------------------------------" << endl;
443 
444  // 10 parameter transformation (X,Y,Z) -> (X',Y',Z')
445 
446  // Helmert 2D transformation (X,Y) -> (X',Y')
447 
448  // Helmert 3D transformation (X,Y,Z) -> (X',Y',Z')
449 
450  // 1D transformation (X,Y,Z) -> (X')
451 
452  // Interpolation (X,Y) -> (X',Y')
453 }
454 
455 void Examples_01()
456 {
457  TGeodeticCoords MAND_92633(
458  TCoords(37, 53, 33.072573).getDecimalValue(),
459  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
460  TGeodeticCoords OROZ_96965(
461  TCoords(37, 35, 31.75505).getDecimalValue(),
462  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
463  TGeodeticCoords SANC_94744(
464  TCoords(37, 44, 29.04253).getDecimalValue(),
465  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
466  TGeodeticCoords ARJO_94633(
467  TCoords(37, 43, 51.28918).getDecimalValue(),
468  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
469  TGeodeticCoords CANI_96833(
470  TCoords(37, 33, 6.94237).getDecimalValue(),
471  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
472  TGeodeticCoords HALC_92543(
473  TCoords(37, 53, 11.26838).getDecimalValue(),
474  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
475 
476  // A2
477  int UTMZone;
478  char UTMBand;
479  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
481  MAND_92633, MAND_UTM, UTMZone, UTMBand, TEllipsoid::Ellipsoid_WGS84());
483  OROZ_96965, OROZ_UTM, UTMZone, UTMBand, TEllipsoid::Ellipsoid_WGS84());
485  SANC_94744, SANC_UTM, UTMZone, UTMBand, TEllipsoid::Ellipsoid_WGS84());
487  ARJO_94633, ARJO_UTM, UTMZone, UTMBand, TEllipsoid::Ellipsoid_WGS84());
489  CANI_96833, CANI_UTM, UTMZone, UTMBand, TEllipsoid::Ellipsoid_WGS84());
491  HALC_92543, HALC_UTM, UTMZone, UTMBand, TEllipsoid::Ellipsoid_WGS84());
492 
493  CVectorDouble thisResults;
494  thisResults.resize(18);
495 
496  thisResults[0] = MAND_UTM.x;
497  thisResults[1] = MAND_UTM.y;
498  thisResults[2] = MAND_UTM.z;
499  thisResults[3] = OROZ_UTM.x;
500  thisResults[4] = OROZ_UTM.y;
501  thisResults[5] = OROZ_UTM.z;
502  thisResults[6] = SANC_UTM.x;
503  thisResults[7] = SANC_UTM.y;
504  thisResults[8] = SANC_UTM.z;
505  thisResults[9] = ARJO_UTM.x;
506  thisResults[10] = ARJO_UTM.y;
507  thisResults[11] = ARJO_UTM.z;
508  thisResults[12] = CANI_UTM.x;
509  thisResults[13] = CANI_UTM.y;
510  thisResults[14] = CANI_UTM.z;
511  thisResults[15] = HALC_UTM.x;
512  thisResults[16] = HALC_UTM.y;
513  thisResults[17] = HALC_UTM.z;
514 
515  displayResults(thisResults, 1, true);
516 }
517 
518 void Examples_02()
519 {
520  TGeodeticCoords MAND_92633(
521  TCoords(37, 53, 33.072573).getDecimalValue(),
522  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
523  TGeodeticCoords OROZ_96965(
524  TCoords(37, 35, 31.75505).getDecimalValue(),
525  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
526  TGeodeticCoords SANC_94744(
527  TCoords(37, 44, 29.04253).getDecimalValue(),
528  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
529  TGeodeticCoords ARJO_94633(
530  TCoords(37, 43, 51.28918).getDecimalValue(),
531  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
532  TGeodeticCoords CANI_96833(
533  TCoords(37, 33, 6.94237).getDecimalValue(),
534  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
535  TGeodeticCoords HALC_92543(
536  TCoords(37, 53, 11.26838).getDecimalValue(),
537  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
538 
539  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Internacional_1924();
540 
541  // A3
542  TGeocentricCoords MAND_Geoc, OROZ_Geoc, SANC_Geoc, ARJO_Geoc, CANI_Geoc,
543  HALC_Geoc;
544  geodeticToGeocentric(MAND_92633, MAND_Geoc, TEllipsoid::Ellipsoid_WGS84());
545  geodeticToGeocentric(OROZ_96965, OROZ_Geoc, TEllipsoid::Ellipsoid_WGS84());
546  geodeticToGeocentric(SANC_94744, SANC_Geoc, TEllipsoid::Ellipsoid_WGS84());
547  geodeticToGeocentric(ARJO_94633, ARJO_Geoc, TEllipsoid::Ellipsoid_WGS84());
548  geodeticToGeocentric(CANI_96833, CANI_Geoc, TEllipsoid::Ellipsoid_WGS84());
549  geodeticToGeocentric(HALC_92543, HALC_Geoc, TEllipsoid::Ellipsoid_WGS84());
550 
551  // A5
552  TGeocentricCoords MAND_Geoc2, OROZ_Geoc2, SANC_Geoc2, ARJO_Geoc2,
553  CANI_Geoc2, HALC_Geoc2;
554  TDatum7Params datum(
555  131.0320, 100.2510, 163.3540, -1.2438, -0.0195, -1.1436, -9.3900);
556  transform7params(MAND_Geoc, datum, MAND_Geoc2);
557  transform7params(OROZ_Geoc, datum, OROZ_Geoc2);
558  transform7params(SANC_Geoc, datum, SANC_Geoc2);
559  transform7params(ARJO_Geoc, datum, ARJO_Geoc2);
560  transform7params(CANI_Geoc, datum, CANI_Geoc2);
561  transform7params(HALC_Geoc, datum, HALC_Geoc2);
562 
563  // A4
564  TGeodeticCoords MAND_Geod, OROZ_Geod, SANC_Geod, ARJO_Geod, CANI_Geod,
565  HALC_Geod;
566  geocentricToGeodetic(MAND_Geoc2, MAND_Geod, ellip);
567  geocentricToGeodetic(OROZ_Geoc2, OROZ_Geod, ellip);
568  geocentricToGeodetic(SANC_Geoc2, SANC_Geod, ellip);
569  geocentricToGeodetic(ARJO_Geoc2, ARJO_Geod, ellip);
570  geocentricToGeodetic(CANI_Geoc2, CANI_Geod, ellip);
571  geocentricToGeodetic(HALC_Geoc2, HALC_Geod, ellip);
572 
573  // A2
574  int UTMZone;
575  char UTMBand;
576  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
577  geodeticToUTM(MAND_Geod, MAND_UTM, UTMZone, UTMBand, ellip);
578  geodeticToUTM(OROZ_Geod, OROZ_UTM, UTMZone, UTMBand, ellip);
579  geodeticToUTM(SANC_Geod, SANC_UTM, UTMZone, UTMBand, ellip);
580  geodeticToUTM(ARJO_Geod, ARJO_UTM, UTMZone, UTMBand, ellip);
581  geodeticToUTM(CANI_Geod, CANI_UTM, UTMZone, UTMBand, ellip);
582  geodeticToUTM(HALC_Geod, HALC_UTM, UTMZone, UTMBand, ellip);
583 
584  CVectorDouble thisResults;
585  thisResults.resize(18);
586 
587  thisResults[0] = MAND_UTM.x;
588  thisResults[1] = MAND_UTM.y;
589  thisResults[2] = MAND_UTM.z;
590  thisResults[3] = OROZ_UTM.x;
591  thisResults[4] = OROZ_UTM.y;
592  thisResults[5] = OROZ_UTM.z;
593  thisResults[6] = SANC_UTM.x;
594  thisResults[7] = SANC_UTM.y;
595  thisResults[8] = SANC_UTM.z;
596  thisResults[9] = ARJO_UTM.x;
597  thisResults[10] = ARJO_UTM.y;
598  thisResults[11] = ARJO_UTM.z;
599  thisResults[12] = CANI_UTM.x;
600  thisResults[13] = CANI_UTM.y;
601  thisResults[14] = CANI_UTM.z;
602  thisResults[15] = HALC_UTM.x;
603  thisResults[16] = HALC_UTM.y;
604  thisResults[17] = HALC_UTM.z;
605 
606  displayResults(thisResults, 2, true);
607 }
608 
609 void Examples_03()
610 {
611  // TOPCON
612  TGeodeticCoords MAND_92633(
613  TCoords(37, 53, 33.072573).getDecimalValue(),
614  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
615  TGeodeticCoords OROZ_96965(
616  TCoords(37, 35, 31.75505).getDecimalValue(),
617  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
618  TGeodeticCoords SANC_94744(
619  TCoords(37, 44, 29.04253).getDecimalValue(),
620  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
621  TGeodeticCoords ARJO_94633(
622  TCoords(37, 43, 51.28918).getDecimalValue(),
623  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
624  TGeodeticCoords CANI_96833(
625  TCoords(37, 33, 6.94237).getDecimalValue(),
626  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
627  TGeodeticCoords HALC_92543(
628  TCoords(37, 53, 11.26838).getDecimalValue(),
629  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
630 
631  const TEllipsoid ellip = TEllipsoid::Ellipsoid_WGS84();
632 
633  // A2
634  int UTMZone;
635  char UTMBand;
636  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
637  geodeticToUTM(MAND_92633, MAND_UTM, UTMZone, UTMBand, ellip);
638  geodeticToUTM(OROZ_96965, OROZ_UTM, UTMZone, UTMBand, ellip);
639  geodeticToUTM(SANC_94744, SANC_UTM, UTMZone, UTMBand, ellip);
640  geodeticToUTM(ARJO_94633, ARJO_UTM, UTMZone, UTMBand, ellip);
641  geodeticToUTM(CANI_96833, CANI_UTM, UTMZone, UTMBand, ellip);
642  geodeticToUTM(HALC_92543, HALC_UTM, UTMZone, UTMBand, ellip);
643 
644  // A7
645  TPoint2D MAND_point, OROZ_point, SANC_point, ARJO_point, CANI_point,
646  HALC_point;
648  1.0000008551, 0.0000002900, 110.1121641064, 202.4657352579);
650  TPoint2D(MAND_UTM.x, MAND_UTM.y), datum, MAND_point);
652  TPoint2D(OROZ_UTM.x, OROZ_UTM.y), datum, OROZ_point);
654  TPoint2D(SANC_UTM.x, SANC_UTM.y), datum, SANC_point);
656  TPoint2D(ARJO_UTM.x, ARJO_UTM.y), datum, ARJO_point);
658  TPoint2D(CANI_UTM.x, CANI_UTM.y), datum, CANI_point);
660  TPoint2D(HALC_UTM.x, HALC_UTM.y), datum, HALC_point);
661 
662  CVectorDouble thisResults;
663  thisResults.resize(18);
664 
665  thisResults[0] = MAND_point.x;
666  thisResults[1] = MAND_point.y;
667  thisResults[2] = MAND_UTM.z;
668  thisResults[3] = OROZ_point.x;
669  thisResults[4] = OROZ_point.y;
670  thisResults[5] = OROZ_UTM.z;
671  thisResults[6] = SANC_point.x;
672  thisResults[7] = SANC_point.y;
673  thisResults[8] = SANC_UTM.z;
674  thisResults[9] = ARJO_point.x;
675  thisResults[10] = ARJO_point.y;
676  thisResults[11] = ARJO_UTM.z;
677  thisResults[12] = CANI_point.x;
678  thisResults[13] = CANI_point.y;
679  thisResults[14] = CANI_UTM.z;
680  thisResults[15] = HALC_point.x;
681  thisResults[16] = HALC_point.y;
682  thisResults[17] = HALC_UTM.z;
683 
684  displayResults(thisResults, 3, true);
685 }
686 
687 void Examples_04()
688 {
689  // TOPCON
690  TGeodeticCoords MAND_92633(
691  TCoords(37, 53, 33.072573).getDecimalValue(),
692  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
693  TGeodeticCoords OROZ_96965(
694  TCoords(37, 35, 31.75505).getDecimalValue(),
695  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
696  TGeodeticCoords SANC_94744(
697  TCoords(37, 44, 29.04253).getDecimalValue(),
698  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
699  TGeodeticCoords ARJO_94633(
700  TCoords(37, 43, 51.28918).getDecimalValue(),
701  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
702  TGeodeticCoords CANI_96833(
703  TCoords(37, 33, 6.94237).getDecimalValue(),
704  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
705  TGeodeticCoords HALC_92543(
706  TCoords(37, 53, 11.26838).getDecimalValue(),
707  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
708 
709  const TEllipsoid ellip = TEllipsoid::Ellipsoid_WGS84();
710 
711  // A2
712  int UTMZone;
713  char UTMBand;
714  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
715  geodeticToUTM(MAND_92633, MAND_UTM, UTMZone, UTMBand, ellip);
716  geodeticToUTM(OROZ_96965, OROZ_UTM, UTMZone, UTMBand, ellip);
717  geodeticToUTM(SANC_94744, SANC_UTM, UTMZone, UTMBand, ellip);
718  geodeticToUTM(ARJO_94633, ARJO_UTM, UTMZone, UTMBand, ellip);
719  geodeticToUTM(CANI_96833, CANI_UTM, UTMZone, UTMBand, ellip);
720  geodeticToUTM(HALC_92543, HALC_UTM, UTMZone, UTMBand, ellip);
721 
722  // A7
723  TUTMCoords MAND_point, OROZ_point, SANC_point, ARJO_point, CANI_point,
724  HALC_point;
726  0.9999969509, -0.0000070551, 142.4402790576, -0.0000060616,
727  1.0000054540, 185.6991268722, -49.4041666667);
728  transformHelmert3D_TOPCON(MAND_UTM, datum, MAND_point);
729  transformHelmert3D_TOPCON(OROZ_UTM, datum, OROZ_point);
730  transformHelmert3D_TOPCON(SANC_UTM, datum, SANC_point);
731  transformHelmert3D_TOPCON(ARJO_UTM, datum, ARJO_point);
732  transformHelmert3D_TOPCON(CANI_UTM, datum, CANI_point);
733  transformHelmert3D_TOPCON(HALC_UTM, datum, HALC_point);
734 
735  CVectorDouble thisResults;
736  thisResults.resize(18);
737 
738  thisResults[0] = MAND_point.x;
739  thisResults[1] = MAND_point.y;
740  thisResults[2] = MAND_point.z;
741  thisResults[3] = OROZ_point.x;
742  thisResults[4] = OROZ_point.y;
743  thisResults[5] = OROZ_point.z;
744  thisResults[6] = SANC_point.x;
745  thisResults[7] = SANC_point.y;
746  thisResults[8] = SANC_point.z;
747  thisResults[9] = ARJO_point.x;
748  thisResults[10] = ARJO_point.y;
749  thisResults[11] = ARJO_point.z;
750  thisResults[12] = CANI_point.x;
751  thisResults[13] = CANI_point.y;
752  thisResults[14] = CANI_point.z;
753  thisResults[15] = HALC_point.x;
754  thisResults[16] = HALC_point.y;
755  thisResults[17] = HALC_point.z;
756 
757  displayResults(thisResults, 4, true);
758 }
759 
760 void Examples_05()
761 {
762  // TOPCON
763  TGeodeticCoords MAND_92633(
764  TCoords(37, 53, 33.072573).getDecimalValue(),
765  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
766  TGeodeticCoords OROZ_96965(
767  TCoords(37, 35, 31.75505).getDecimalValue(),
768  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
769  TGeodeticCoords SANC_94744(
770  TCoords(37, 44, 29.04253).getDecimalValue(),
771  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
772  TGeodeticCoords ARJO_94633(
773  TCoords(37, 43, 51.28918).getDecimalValue(),
774  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
775  TGeodeticCoords CANI_96833(
776  TCoords(37, 33, 6.94237).getDecimalValue(),
777  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
778  TGeodeticCoords HALC_92543(
779  TCoords(37, 53, 11.26838).getDecimalValue(),
780  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
781 
782  const TEllipsoid ellip = TEllipsoid(6378137, 6356752.31424518, "USER");
783 
784  // A2
785  int UTMZone;
786  char UTMBand;
787  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
788  geodeticToUTM(MAND_92633, MAND_UTM, UTMZone, UTMBand, ellip);
789  geodeticToUTM(OROZ_96965, OROZ_UTM, UTMZone, UTMBand, ellip);
790  geodeticToUTM(SANC_94744, SANC_UTM, UTMZone, UTMBand, ellip);
791  geodeticToUTM(ARJO_94633, ARJO_UTM, UTMZone, UTMBand, ellip);
792  geodeticToUTM(CANI_96833, CANI_UTM, UTMZone, UTMBand, ellip);
793  geodeticToUTM(HALC_92543, HALC_UTM, UTMZone, UTMBand, ellip);
794 
795  // A5
796  TUTMCoords MAND_point, OROZ_point, SANC_point, ARJO_point, CANI_point,
797  HALC_point;
798  TDatum7Params_TOPCON datum(
799  109.035107801496, 202.610276063935, 32.727057571807, 0.9999999999,
800  0.0000005460, 0.0000156068, -0.0000005463, 0.9999999998, 0.0000180851,
801  -0.0000156068, -0.0000180851, 0.9999999997, 0.842993545636);
802  transform7params_TOPCON(MAND_UTM, datum, MAND_point);
803  transform7params_TOPCON(OROZ_UTM, datum, OROZ_point);
804  transform7params_TOPCON(SANC_UTM, datum, SANC_point);
805  transform7params_TOPCON(ARJO_UTM, datum, ARJO_point);
806  transform7params_TOPCON(CANI_UTM, datum, CANI_point);
807  transform7params_TOPCON(HALC_UTM, datum, HALC_point);
808 
809  CVectorDouble thisResults;
810  thisResults.resize(18);
811 
812  thisResults[0] = MAND_point.x;
813  thisResults[1] = MAND_point.y;
814  thisResults[2] = MAND_point.z;
815  thisResults[3] = OROZ_point.x;
816  thisResults[4] = OROZ_point.y;
817  thisResults[5] = OROZ_point.z;
818  thisResults[6] = SANC_point.x;
819  thisResults[7] = SANC_point.y;
820  thisResults[8] = SANC_point.z;
821  thisResults[9] = ARJO_point.x;
822  thisResults[10] = ARJO_point.y;
823  thisResults[11] = ARJO_point.z;
824  thisResults[12] = CANI_point.x;
825  thisResults[13] = CANI_point.y;
826  thisResults[14] = CANI_point.z;
827  thisResults[15] = HALC_point.x;
828  thisResults[16] = HALC_point.y;
829  thisResults[17] = HALC_point.z;
830 
831  displayResults(thisResults, 5, true);
832 }
833 
834 void Examples_06()
835 {
836  TGeodeticCoords MAND_92633(
837  TCoords(37, 53, 33.072573).getDecimalValue(),
838  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
839  TGeodeticCoords OROZ_96965(
840  TCoords(37, 35, 31.75505).getDecimalValue(),
841  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
842  TGeodeticCoords SANC_94744(
843  TCoords(37, 44, 29.04253).getDecimalValue(),
844  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
845  TGeodeticCoords ARJO_94633(
846  TCoords(37, 43, 51.28918).getDecimalValue(),
847  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
848  TGeodeticCoords CANI_96833(
849  TCoords(37, 33, 6.94237).getDecimalValue(),
850  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
851  TGeodeticCoords HALC_92543(
852  TCoords(37, 53, 11.26838).getDecimalValue(),
853  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
854 
855  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Internacional_1924();
856 
857  // A3
858  TGeocentricCoords MAND_Geoc, OROZ_Geoc, SANC_Geoc, ARJO_Geoc, CANI_Geoc,
859  HALC_Geoc;
860  geodeticToGeocentric(MAND_92633, MAND_Geoc, ellip);
861  geodeticToGeocentric(OROZ_96965, OROZ_Geoc, ellip);
862  geodeticToGeocentric(SANC_94744, SANC_Geoc, ellip);
863  geodeticToGeocentric(ARJO_94633, ARJO_Geoc, ellip);
864  geodeticToGeocentric(CANI_96833, CANI_Geoc, ellip);
865  geodeticToGeocentric(HALC_92543, HALC_Geoc, ellip);
866 
867  // A5
868  TGeocentricCoords MAND_Geoc2, OROZ_Geoc2, SANC_Geoc2, ARJO_Geoc2,
869  CANI_Geoc2, HALC_Geoc2;
870  TDatum7Params datum(
871  131.0320, 100.2510, 163.3540, -1.2438, -0.0195, -1.1436, -9.3900);
872  transform7params(MAND_Geoc, datum, MAND_Geoc2);
873  transform7params(OROZ_Geoc, datum, OROZ_Geoc2);
874  transform7params(SANC_Geoc, datum, SANC_Geoc2);
875  transform7params(ARJO_Geoc, datum, ARJO_Geoc2);
876  transform7params(CANI_Geoc, datum, CANI_Geoc2);
877  transform7params(HALC_Geoc, datum, HALC_Geoc2);
878 
879  // A4
880  TGeodeticCoords MAND_Geod, OROZ_Geod, SANC_Geod, ARJO_Geod, CANI_Geod,
881  HALC_Geod;
882  geocentricToGeodetic(MAND_Geoc2, MAND_Geod, ellip);
883  geocentricToGeodetic(OROZ_Geoc2, OROZ_Geod, ellip);
884  geocentricToGeodetic(SANC_Geoc2, SANC_Geod, ellip);
885  geocentricToGeodetic(ARJO_Geoc2, ARJO_Geod, ellip);
886  geocentricToGeodetic(CANI_Geoc2, CANI_Geod, ellip);
887  geocentricToGeodetic(HALC_Geoc2, HALC_Geod, ellip);
888 
889  // A2
890  int UTMZone;
891  char UTMBand;
892  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
893  geodeticToUTM(MAND_Geod, MAND_UTM, UTMZone, UTMBand, ellip);
894  geodeticToUTM(OROZ_Geod, OROZ_UTM, UTMZone, UTMBand, ellip);
895  geodeticToUTM(SANC_Geod, SANC_UTM, UTMZone, UTMBand, ellip);
896  geodeticToUTM(ARJO_Geod, ARJO_UTM, UTMZone, UTMBand, ellip);
897  geodeticToUTM(CANI_Geod, CANI_UTM, UTMZone, UTMBand, ellip);
898  geodeticToUTM(HALC_Geod, HALC_UTM, UTMZone, UTMBand, ellip);
899 
900  CVectorDouble thisResults;
901  thisResults.resize(18);
902 
903  thisResults[0] = MAND_UTM.x;
904  thisResults[1] = MAND_UTM.y;
905  thisResults[2] = MAND_UTM.z;
906  thisResults[3] = OROZ_UTM.x;
907  thisResults[4] = OROZ_UTM.y;
908  thisResults[5] = OROZ_UTM.z;
909  thisResults[6] = SANC_UTM.x;
910  thisResults[7] = SANC_UTM.y;
911  thisResults[8] = SANC_UTM.z;
912  thisResults[9] = ARJO_UTM.x;
913  thisResults[10] = ARJO_UTM.y;
914  thisResults[11] = ARJO_UTM.z;
915  thisResults[12] = CANI_UTM.x;
916  thisResults[13] = CANI_UTM.y;
917  thisResults[14] = CANI_UTM.z;
918  thisResults[15] = HALC_UTM.x;
919  thisResults[16] = HALC_UTM.y;
920  thisResults[17] = HALC_UTM.z;
921 
922  displayResults(thisResults, 6, false);
923 
924  // A7
925  TPoint2D MAND_point, OROZ_point, SANC_point, ARJO_point, CANI_point,
926  HALC_point;
928  0.9999980621, 0.0000078756, -31.7350304827, 10.8014994871);
930  TPoint2D(MAND_UTM.x, MAND_UTM.y), dat, MAND_point);
932  TPoint2D(OROZ_UTM.x, OROZ_UTM.y), dat, OROZ_point);
934  TPoint2D(SANC_UTM.x, SANC_UTM.y), dat, SANC_point);
936  TPoint2D(ARJO_UTM.x, ARJO_UTM.y), dat, ARJO_point);
938  TPoint2D(CANI_UTM.x, CANI_UTM.y), dat, CANI_point);
940  TPoint2D(HALC_UTM.x, HALC_UTM.y), dat, HALC_point);
941 
942  thisResults[0] = MAND_point.x;
943  thisResults[1] = MAND_point.y;
944  thisResults[2] = MAND_UTM.z;
945  thisResults[3] = OROZ_point.x;
946  thisResults[4] = OROZ_point.y;
947  thisResults[5] = OROZ_UTM.z;
948  thisResults[6] = SANC_point.x;
949  thisResults[7] = SANC_point.y;
950  thisResults[8] = SANC_UTM.z;
951  thisResults[9] = ARJO_point.x;
952  thisResults[10] = ARJO_point.y;
953  thisResults[11] = ARJO_UTM.z;
954  thisResults[12] = CANI_point.x;
955  thisResults[13] = CANI_point.y;
956  thisResults[14] = CANI_UTM.z;
957  thisResults[15] = HALC_point.x;
958  thisResults[16] = HALC_point.y;
959  thisResults[17] = HALC_UTM.z;
960 
961  displayResults(thisResults, 6, true);
962 }
963 
964 void Examples_07()
965 {
966  TGeodeticCoords MAND_92633(
967  TCoords(37, 53, 33.072573).getDecimalValue(),
968  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
969  TGeodeticCoords OROZ_96965(
970  TCoords(37, 35, 31.75505).getDecimalValue(),
971  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
972  TGeodeticCoords SANC_94744(
973  TCoords(37, 44, 29.04253).getDecimalValue(),
974  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
975  TGeodeticCoords ARJO_94633(
976  TCoords(37, 43, 51.28918).getDecimalValue(),
977  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
978  TGeodeticCoords CANI_96833(
979  TCoords(37, 33, 6.94237).getDecimalValue(),
980  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
981  TGeodeticCoords HALC_92543(
982  TCoords(37, 53, 11.26838).getDecimalValue(),
983  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
984 
985  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Internacional_1924();
986 
987  // A3
988  TGeocentricCoords MAND_Geoc, OROZ_Geoc, SANC_Geoc, ARJO_Geoc, CANI_Geoc,
989  HALC_Geoc;
990  geodeticToGeocentric(MAND_92633, MAND_Geoc, ellip);
991  geodeticToGeocentric(OROZ_96965, OROZ_Geoc, ellip);
992  geodeticToGeocentric(SANC_94744, SANC_Geoc, ellip);
993  geodeticToGeocentric(ARJO_94633, ARJO_Geoc, ellip);
994  geodeticToGeocentric(CANI_96833, CANI_Geoc, ellip);
995  geodeticToGeocentric(HALC_92543, HALC_Geoc, ellip);
996 
997  // A5
998  TGeocentricCoords MAND_Geoc2, OROZ_Geoc2, SANC_Geoc2, ARJO_Geoc2,
999  CANI_Geoc2, HALC_Geoc2;
1000  TDatum7Params datum(
1001  131.0320, 100.2510, 163.3540, -1.2438, -0.0195, -1.1436, -9.3900);
1002  transform7params(MAND_Geoc, datum, MAND_Geoc2);
1003  transform7params(OROZ_Geoc, datum, OROZ_Geoc2);
1004  transform7params(SANC_Geoc, datum, SANC_Geoc2);
1005  transform7params(ARJO_Geoc, datum, ARJO_Geoc2);
1006  transform7params(CANI_Geoc, datum, CANI_Geoc2);
1007  transform7params(HALC_Geoc, datum, HALC_Geoc2);
1008 
1009  // A4
1010  TGeodeticCoords MAND_Geod, OROZ_Geod, SANC_Geod, ARJO_Geod, CANI_Geod,
1011  HALC_Geod;
1012  geocentricToGeodetic(MAND_Geoc2, MAND_Geod, ellip);
1013  geocentricToGeodetic(OROZ_Geoc2, OROZ_Geod, ellip);
1014  geocentricToGeodetic(SANC_Geoc2, SANC_Geod, ellip);
1015  geocentricToGeodetic(ARJO_Geoc2, ARJO_Geod, ellip);
1016  geocentricToGeodetic(CANI_Geoc2, CANI_Geod, ellip);
1017  geocentricToGeodetic(HALC_Geoc2, HALC_Geod, ellip);
1018 
1019  // A2
1020  int UTMZone;
1021  char UTMBand;
1022  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
1023  geodeticToUTM(MAND_Geod, MAND_UTM, UTMZone, UTMBand, ellip);
1024  geodeticToUTM(OROZ_Geod, OROZ_UTM, UTMZone, UTMBand, ellip);
1025  geodeticToUTM(SANC_Geod, SANC_UTM, UTMZone, UTMBand, ellip);
1026  geodeticToUTM(ARJO_Geod, ARJO_UTM, UTMZone, UTMBand, ellip);
1027  geodeticToUTM(CANI_Geod, CANI_UTM, UTMZone, UTMBand, ellip);
1028  geodeticToUTM(HALC_Geod, HALC_UTM, UTMZone, UTMBand, ellip);
1029 
1030  CVectorDouble thisResults;
1031  thisResults.resize(18);
1032 
1033  thisResults[0] = MAND_UTM.x;
1034  thisResults[1] = MAND_UTM.y;
1035  thisResults[2] = MAND_UTM.z;
1036  thisResults[3] = OROZ_UTM.x;
1037  thisResults[4] = OROZ_UTM.y;
1038  thisResults[5] = OROZ_UTM.z;
1039  thisResults[6] = SANC_UTM.x;
1040  thisResults[7] = SANC_UTM.y;
1041  thisResults[8] = SANC_UTM.z;
1042  thisResults[9] = ARJO_UTM.x;
1043  thisResults[10] = ARJO_UTM.y;
1044  thisResults[11] = ARJO_UTM.z;
1045  thisResults[12] = CANI_UTM.x;
1046  thisResults[13] = CANI_UTM.y;
1047  thisResults[14] = CANI_UTM.z;
1048  thisResults[15] = HALC_UTM.x;
1049  thisResults[16] = HALC_UTM.y;
1050  thisResults[17] = HALC_UTM.z;
1051 
1052  displayResults(thisResults, 7, false);
1053 
1054  // A8
1055  TPoint3D MAND_point, OROZ_point, SANC_point, ARJO_point, CANI_point,
1056  HALC_point;
1058  0.9999944446, 0.0000005236, 0.5022460081, -0.0000136628, 1.0000023039,
1059  -4.4675776973, 29.2747378118);
1060  transformHelmert3D_TOPCON(MAND_UTM, dat, MAND_point);
1061  transformHelmert3D_TOPCON(OROZ_UTM, dat, OROZ_point);
1062  transformHelmert3D_TOPCON(SANC_UTM, dat, SANC_point);
1063  transformHelmert3D_TOPCON(ARJO_UTM, dat, ARJO_point);
1064  transformHelmert3D_TOPCON(CANI_UTM, dat, CANI_point);
1065  transformHelmert3D_TOPCON(HALC_UTM, dat, HALC_point);
1066 
1067  thisResults[0] = MAND_point.x;
1068  thisResults[1] = MAND_point.y;
1069  thisResults[2] = MAND_point.z;
1070  thisResults[3] = OROZ_point.x;
1071  thisResults[4] = OROZ_point.y;
1072  thisResults[5] = OROZ_point.z;
1073  thisResults[6] = SANC_point.x;
1074  thisResults[7] = SANC_point.y;
1075  thisResults[8] = SANC_point.z;
1076  thisResults[9] = ARJO_point.x;
1077  thisResults[10] = ARJO_point.y;
1078  thisResults[11] = ARJO_point.z;
1079  thisResults[12] = CANI_point.x;
1080  thisResults[13] = CANI_point.y;
1081  thisResults[14] = CANI_point.z;
1082  thisResults[15] = HALC_point.x;
1083  thisResults[16] = HALC_point.y;
1084  thisResults[17] = HALC_point.z;
1085 
1086  displayResults(thisResults, 7, true);
1087 }
1088 
1089 void Examples_08()
1090 {
1091  TGeodeticCoords MAND_92633(
1092  TCoords(37, 53, 33.072573).getDecimalValue(),
1093  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
1094  TGeodeticCoords OROZ_96965(
1095  TCoords(37, 35, 31.75505).getDecimalValue(),
1096  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
1097  TGeodeticCoords SANC_94744(
1098  TCoords(37, 44, 29.04253).getDecimalValue(),
1099  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
1100  TGeodeticCoords ARJO_94633(
1101  TCoords(37, 43, 51.28918).getDecimalValue(),
1102  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
1103  TGeodeticCoords CANI_96833(
1104  TCoords(37, 33, 6.94237).getDecimalValue(),
1105  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
1106  TGeodeticCoords HALC_92543(
1107  TCoords(37, 53, 11.26838).getDecimalValue(),
1108  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
1109 
1110  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Internacional_1924();
1111 
1112  // A3
1113  TGeocentricCoords MAND_Geoc, OROZ_Geoc, SANC_Geoc, ARJO_Geoc, CANI_Geoc,
1114  HALC_Geoc;
1115  geodeticToGeocentric(MAND_92633, MAND_Geoc, ellip);
1116  geodeticToGeocentric(OROZ_96965, OROZ_Geoc, ellip);
1117  geodeticToGeocentric(SANC_94744, SANC_Geoc, ellip);
1118  geodeticToGeocentric(ARJO_94633, ARJO_Geoc, ellip);
1119  geodeticToGeocentric(CANI_96833, CANI_Geoc, ellip);
1120  geodeticToGeocentric(HALC_92543, HALC_Geoc, ellip);
1121 
1122  // A5
1123  TGeocentricCoords MAND_Geoc2, OROZ_Geoc2, SANC_Geoc2, ARJO_Geoc2,
1124  CANI_Geoc2, HALC_Geoc2;
1125  TDatum7Params datum(
1126  131.0320, 100.2510, 163.3540, -1.2438, -0.0195, -1.1436, -9.3900);
1127  transform7params(MAND_Geoc, datum, MAND_Geoc2);
1128  transform7params(OROZ_Geoc, datum, OROZ_Geoc2);
1129  transform7params(SANC_Geoc, datum, SANC_Geoc2);
1130  transform7params(ARJO_Geoc, datum, ARJO_Geoc2);
1131  transform7params(CANI_Geoc, datum, CANI_Geoc2);
1132  transform7params(HALC_Geoc, datum, HALC_Geoc2);
1133 
1134  // A4
1135  TGeodeticCoords MAND_Geod, OROZ_Geod, SANC_Geod, ARJO_Geod, CANI_Geod,
1136  HALC_Geod;
1137  geocentricToGeodetic(MAND_Geoc2, MAND_Geod, ellip);
1138  geocentricToGeodetic(OROZ_Geoc2, OROZ_Geod, ellip);
1139  geocentricToGeodetic(SANC_Geoc2, SANC_Geod, ellip);
1140  geocentricToGeodetic(ARJO_Geoc2, ARJO_Geod, ellip);
1141  geocentricToGeodetic(CANI_Geoc2, CANI_Geod, ellip);
1142  geocentricToGeodetic(HALC_Geoc2, HALC_Geod, ellip);
1143 
1144  // A2
1145  int UTMZone;
1146  char UTMBand;
1147  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
1148  geodeticToUTM(MAND_Geod, MAND_UTM, UTMZone, UTMBand, ellip);
1149  geodeticToUTM(OROZ_Geod, OROZ_UTM, UTMZone, UTMBand, ellip);
1150  geodeticToUTM(SANC_Geod, SANC_UTM, UTMZone, UTMBand, ellip);
1151  geodeticToUTM(ARJO_Geod, ARJO_UTM, UTMZone, UTMBand, ellip);
1152  geodeticToUTM(CANI_Geod, CANI_UTM, UTMZone, UTMBand, ellip);
1153  geodeticToUTM(HALC_Geod, HALC_UTM, UTMZone, UTMBand, ellip);
1154 
1155  CVectorDouble thisResults;
1156  thisResults.resize(18);
1157 
1158  thisResults[0] = MAND_UTM.x;
1159  thisResults[1] = MAND_UTM.y;
1160  thisResults[2] = MAND_UTM.z;
1161  thisResults[3] = OROZ_UTM.x;
1162  thisResults[4] = OROZ_UTM.y;
1163  thisResults[5] = OROZ_UTM.z;
1164  thisResults[6] = SANC_UTM.x;
1165  thisResults[7] = SANC_UTM.y;
1166  thisResults[8] = SANC_UTM.z;
1167  thisResults[9] = ARJO_UTM.x;
1168  thisResults[10] = ARJO_UTM.y;
1169  thisResults[11] = ARJO_UTM.z;
1170  thisResults[12] = CANI_UTM.x;
1171  thisResults[13] = CANI_UTM.y;
1172  thisResults[14] = CANI_UTM.z;
1173  thisResults[15] = HALC_UTM.x;
1174  thisResults[16] = HALC_UTM.y;
1175  thisResults[17] = HALC_UTM.z;
1176 
1177  displayResults(thisResults, 8, false);
1178 
1179  // A5
1180  TGeocentricCoords MAND_Geoc3, OROZ_Geoc3, SANC_Geoc3, ARJO_Geoc3,
1181  CANI_Geoc3, HALC_Geoc3;
1182  // TDatum7Params dat( -34.095438458048, 10.843234125336,
1183  // 212.169692142148,
1184  // -8.348308019638, 6.751893142065, -1.738975581025, -1.898114919019 );
1186  -34.095438458048, 10.843234125336, 212.169692142148, 0.9999999994,
1187  0.0000084308, 0.0000327341, -0.0000084321, 0.9999999991, 0.0000404737,
1188  -0.0000327338, -0.0000404737, 0.9999999986, -1.898114919019);
1189  transform7params_TOPCON(MAND_UTM, dat, MAND_Geoc3);
1190  transform7params_TOPCON(OROZ_UTM, dat, OROZ_Geoc3);
1191  transform7params_TOPCON(SANC_UTM, dat, SANC_Geoc3);
1192  transform7params_TOPCON(ARJO_UTM, dat, ARJO_Geoc3);
1193  transform7params_TOPCON(CANI_UTM, dat, CANI_Geoc3);
1194  transform7params_TOPCON(HALC_UTM, dat, HALC_Geoc3);
1195 
1196  thisResults[0] = MAND_Geoc3.x;
1197  thisResults[1] = MAND_Geoc3.y;
1198  thisResults[2] = MAND_Geoc3.z;
1199  thisResults[3] = OROZ_Geoc3.x;
1200  thisResults[4] = OROZ_Geoc3.y;
1201  thisResults[5] = OROZ_Geoc3.z;
1202  thisResults[6] = SANC_Geoc3.x;
1203  thisResults[7] = SANC_Geoc3.y;
1204  thisResults[8] = SANC_Geoc3.z;
1205  thisResults[9] = ARJO_Geoc3.x;
1206  thisResults[10] = ARJO_Geoc3.y;
1207  thisResults[11] = ARJO_Geoc3.z;
1208  thisResults[12] = CANI_Geoc3.x;
1209  thisResults[13] = CANI_Geoc3.y;
1210  thisResults[14] = CANI_Geoc3.z;
1211  thisResults[15] = HALC_Geoc3.x;
1212  thisResults[16] = HALC_Geoc3.y;
1213  thisResults[17] = HALC_Geoc3.z;
1214 
1215  displayResults(thisResults, 8, true);
1216 }
1217 
1218 void Examples_10()
1219 {
1220  TGeodeticCoords MAND_92633(
1221  TCoords(37, 53, 33.072573).getDecimalValue(),
1222  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
1223  TGeodeticCoords OROZ_96965(
1224  TCoords(37, 35, 31.75505).getDecimalValue(),
1225  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
1226  TGeodeticCoords SANC_94744(
1227  TCoords(37, 44, 29.04253).getDecimalValue(),
1228  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
1229  TGeodeticCoords ARJO_94633(
1230  TCoords(37, 43, 51.28918).getDecimalValue(),
1231  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
1232  TGeodeticCoords CANI_96833(
1233  TCoords(37, 33, 6.94237).getDecimalValue(),
1234  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
1235  TGeodeticCoords HALC_92543(
1236  TCoords(37, 53, 11.26838).getDecimalValue(),
1237  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
1238 
1239  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Hayford_1909();
1240 
1241  // A3
1242  TGeocentricCoords MAND_Geoc, OROZ_Geoc, SANC_Geoc, ARJO_Geoc, CANI_Geoc,
1243  HALC_Geoc;
1244  geodeticToGeocentric(MAND_92633, MAND_Geoc, ellip);
1245  geodeticToGeocentric(OROZ_96965, OROZ_Geoc, ellip);
1246  geodeticToGeocentric(SANC_94744, SANC_Geoc, ellip);
1247  geodeticToGeocentric(ARJO_94633, ARJO_Geoc, ellip);
1248  geodeticToGeocentric(CANI_96833, CANI_Geoc, ellip);
1249  geodeticToGeocentric(HALC_92543, HALC_Geoc, ellip);
1250 
1251  // A5
1252  TGeocentricCoords MAND_Geoc2, OROZ_Geoc2, SANC_Geoc2, ARJO_Geoc2,
1253  CANI_Geoc2, HALC_Geoc2;
1254  TDatum7Params datum(
1255  284.2535, -116.9549, -34.8027, 4.78337, 7.96684, -5.37707, -6.6900);
1256  transform7params(MAND_Geoc, datum, MAND_Geoc2);
1257  transform7params(OROZ_Geoc, datum, OROZ_Geoc2);
1258  transform7params(SANC_Geoc, datum, SANC_Geoc2);
1259  transform7params(ARJO_Geoc, datum, ARJO_Geoc2);
1260  transform7params(CANI_Geoc, datum, CANI_Geoc2);
1261  transform7params(HALC_Geoc, datum, HALC_Geoc2);
1262 
1263  // A4
1264  TGeodeticCoords MAND_Geod, OROZ_Geod, SANC_Geod, ARJO_Geod, CANI_Geod,
1265  HALC_Geod;
1266  geocentricToGeodetic(MAND_Geoc2, MAND_Geod, ellip);
1267  geocentricToGeodetic(OROZ_Geoc2, OROZ_Geod, ellip);
1268  geocentricToGeodetic(SANC_Geoc2, SANC_Geod, ellip);
1269  geocentricToGeodetic(ARJO_Geoc2, ARJO_Geod, ellip);
1270  geocentricToGeodetic(CANI_Geoc2, CANI_Geod, ellip);
1271  geocentricToGeodetic(HALC_Geoc2, HALC_Geod, ellip);
1272 
1273  // A2
1274  int UTMZone;
1275  char UTMBand;
1276  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
1277  geodeticToUTM(MAND_Geod, MAND_UTM, UTMZone, UTMBand, ellip);
1278  geodeticToUTM(OROZ_Geod, OROZ_UTM, UTMZone, UTMBand, ellip);
1279  geodeticToUTM(SANC_Geod, SANC_UTM, UTMZone, UTMBand, ellip);
1280  geodeticToUTM(ARJO_Geod, ARJO_UTM, UTMZone, UTMBand, ellip);
1281  geodeticToUTM(CANI_Geod, CANI_UTM, UTMZone, UTMBand, ellip);
1282  geodeticToUTM(HALC_Geod, HALC_UTM, UTMZone, UTMBand, ellip);
1283 
1284  CVectorDouble thisResults;
1285  thisResults.resize(18);
1286 
1287  thisResults[0] = MAND_UTM.x;
1288  thisResults[1] = MAND_UTM.y;
1289  thisResults[2] = MAND_UTM.z;
1290  thisResults[3] = OROZ_UTM.x;
1291  thisResults[4] = OROZ_UTM.y;
1292  thisResults[5] = OROZ_UTM.z;
1293  thisResults[6] = SANC_UTM.x;
1294  thisResults[7] = SANC_UTM.y;
1295  thisResults[8] = SANC_UTM.z;
1296  thisResults[9] = ARJO_UTM.x;
1297  thisResults[10] = ARJO_UTM.y;
1298  thisResults[11] = ARJO_UTM.z;
1299  thisResults[12] = CANI_UTM.x;
1300  thisResults[13] = CANI_UTM.y;
1301  thisResults[14] = CANI_UTM.z;
1302  thisResults[15] = HALC_UTM.x;
1303  thisResults[16] = HALC_UTM.y;
1304  thisResults[17] = HALC_UTM.z;
1305 
1306  displayResults(thisResults, 10, true);
1307 }
1308 
1309 void Examples_11()
1310 {
1311  TGeodeticCoords MAND_92633(
1312  TCoords(37, 53, 33.072573).getDecimalValue(),
1313  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
1314  TGeodeticCoords OROZ_96965(
1315  TCoords(37, 35, 31.75505).getDecimalValue(),
1316  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
1317  TGeodeticCoords SANC_94744(
1318  TCoords(37, 44, 29.04253).getDecimalValue(),
1319  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
1320  TGeodeticCoords ARJO_94633(
1321  TCoords(37, 43, 51.28918).getDecimalValue(),
1322  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
1323  TGeodeticCoords CANI_96833(
1324  TCoords(37, 33, 6.94237).getDecimalValue(),
1325  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
1326  TGeodeticCoords HALC_92543(
1327  TCoords(37, 53, 11.26838).getDecimalValue(),
1328  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
1329 
1330  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Hayford_1909();
1331 
1332  // A3
1333  TGeocentricCoords MAND_Geoc, OROZ_Geoc, SANC_Geoc, ARJO_Geoc, CANI_Geoc,
1334  HALC_Geoc;
1335  geodeticToGeocentric(MAND_92633, MAND_Geoc, ellip);
1336  geodeticToGeocentric(OROZ_96965, OROZ_Geoc, ellip);
1337  geodeticToGeocentric(SANC_94744, SANC_Geoc, ellip);
1338  geodeticToGeocentric(ARJO_94633, ARJO_Geoc, ellip);
1339  geodeticToGeocentric(CANI_96833, CANI_Geoc, ellip);
1340  geodeticToGeocentric(HALC_92543, HALC_Geoc, ellip);
1341 
1342  // A6
1343  TGeocentricCoords MAND_Geoc2, OROZ_Geoc2, SANC_Geoc2, ARJO_Geoc2,
1344  CANI_Geoc2, HALC_Geoc2;
1345  TDatum10Params datum(
1346  109.4714, 106.7407, 141.7916, 5039726.4242, -341417.6071, 3882515.5524,
1347  4.78337, 7.96684, -5.37707, -6.6900);
1348  transform10params(MAND_Geoc, datum, MAND_Geoc2);
1349  transform10params(OROZ_Geoc, datum, OROZ_Geoc2);
1350  transform10params(SANC_Geoc, datum, SANC_Geoc2);
1351  transform10params(ARJO_Geoc, datum, ARJO_Geoc2);
1352  transform10params(CANI_Geoc, datum, CANI_Geoc2);
1353  transform10params(HALC_Geoc, datum, HALC_Geoc2);
1354 
1355  // A4
1356  TGeodeticCoords MAND_Geod, OROZ_Geod, SANC_Geod, ARJO_Geod, CANI_Geod,
1357  HALC_Geod;
1358  geocentricToGeodetic(MAND_Geoc2, MAND_Geod, ellip);
1359  geocentricToGeodetic(OROZ_Geoc2, OROZ_Geod, ellip);
1360  geocentricToGeodetic(SANC_Geoc2, SANC_Geod, ellip);
1361  geocentricToGeodetic(ARJO_Geoc2, ARJO_Geod, ellip);
1362  geocentricToGeodetic(CANI_Geoc2, CANI_Geod, ellip);
1363  geocentricToGeodetic(HALC_Geoc2, HALC_Geod, ellip);
1364 
1365  // A2
1366  int UTMZone;
1367  char UTMBand;
1368  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
1369  geodeticToUTM(MAND_Geod, MAND_UTM, UTMZone, UTMBand, ellip);
1370  geodeticToUTM(OROZ_Geod, OROZ_UTM, UTMZone, UTMBand, ellip);
1371  geodeticToUTM(SANC_Geod, SANC_UTM, UTMZone, UTMBand, ellip);
1372  geodeticToUTM(ARJO_Geod, ARJO_UTM, UTMZone, UTMBand, ellip);
1373  geodeticToUTM(CANI_Geod, CANI_UTM, UTMZone, UTMBand, ellip);
1374  geodeticToUTM(HALC_Geod, HALC_UTM, UTMZone, UTMBand, ellip);
1375 
1376  CVectorDouble thisResults;
1377  thisResults.resize(18);
1378 
1379  thisResults[0] = MAND_UTM.x;
1380  thisResults[1] = MAND_UTM.y;
1381  thisResults[2] = MAND_UTM.z;
1382  thisResults[3] = OROZ_UTM.x;
1383  thisResults[4] = OROZ_UTM.y;
1384  thisResults[5] = OROZ_UTM.z;
1385  thisResults[6] = SANC_UTM.x;
1386  thisResults[7] = SANC_UTM.y;
1387  thisResults[8] = SANC_UTM.z;
1388  thisResults[9] = ARJO_UTM.x;
1389  thisResults[10] = ARJO_UTM.y;
1390  thisResults[11] = ARJO_UTM.z;
1391  thisResults[12] = CANI_UTM.x;
1392  thisResults[13] = CANI_UTM.y;
1393  thisResults[14] = CANI_UTM.z;
1394  thisResults[15] = HALC_UTM.x;
1395  thisResults[16] = HALC_UTM.y;
1396  thisResults[17] = HALC_UTM.z;
1397 
1398  displayResults(thisResults, 11, true);
1399 }
1400 
1401 void Examples_12()
1402 {
1403  TGeodeticCoords MAND_92633(
1404  TCoords(37, 53, 33.072573).getDecimalValue(),
1405  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
1406  TGeodeticCoords OROZ_96965(
1407  TCoords(37, 35, 31.75505).getDecimalValue(),
1408  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
1409  TGeodeticCoords SANC_94744(
1410  TCoords(37, 44, 29.04253).getDecimalValue(),
1411  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
1412  TGeodeticCoords ARJO_94633(
1413  TCoords(37, 43, 51.28918).getDecimalValue(),
1414  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
1415  TGeodeticCoords CANI_96833(
1416  TCoords(37, 33, 6.94237).getDecimalValue(),
1417  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
1418  TGeodeticCoords HALC_92543(
1419  TCoords(37, 53, 11.26838).getDecimalValue(),
1420  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
1421 
1422  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Hayford_1909();
1423 
1424  // A2
1425  int UTMZone;
1426  char UTMBand;
1427  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
1428  geodeticToUTM(MAND_92633, MAND_UTM, UTMZone, UTMBand, ellip);
1429  geodeticToUTM(OROZ_96965, OROZ_UTM, UTMZone, UTMBand, ellip);
1430  geodeticToUTM(SANC_94744, SANC_UTM, UTMZone, UTMBand, ellip);
1431  geodeticToUTM(ARJO_94633, ARJO_UTM, UTMZone, UTMBand, ellip);
1432  geodeticToUTM(CANI_96833, CANI_UTM, UTMZone, UTMBand, ellip);
1433  geodeticToUTM(HALC_92543, HALC_UTM, UTMZone, UTMBand, ellip);
1434 
1435  // A7
1436  TPoint2D MAND_point, OROZ_point, SANC_point, ARJO_point, CANI_point,
1437  HALC_point;
1438  TDatumHelmert2D dat(
1439  15.8778, 0.4491, TCoords(0, 32, 8.75881).getDecimalValue() /*degrees*/,
1440  -325.9604, 422956.6976, 4176709.7722);
1441  transformHelmert2D(TPoint2D(MAND_UTM.x, MAND_UTM.y), dat, MAND_point);
1442  transformHelmert2D(TPoint2D(OROZ_UTM.x, OROZ_UTM.y), dat, OROZ_point);
1443  transformHelmert2D(TPoint2D(SANC_UTM.x, SANC_UTM.y), dat, SANC_point);
1444  transformHelmert2D(TPoint2D(ARJO_UTM.x, ARJO_UTM.y), dat, ARJO_point);
1445  transformHelmert2D(TPoint2D(CANI_UTM.x, CANI_UTM.y), dat, CANI_point);
1446  transformHelmert2D(TPoint2D(HALC_UTM.x, HALC_UTM.y), dat, HALC_point);
1447 
1448  // A9
1449  TPoint3D MAND_point2, OROZ_point2, SANC_point2, ARJO_point2, CANI_point2,
1450  HALC_point2;
1451  TDatum1DTransf datum(-0.00001847 /*rad*/, -0.00001536 /*rad*/, -49.4041, 0);
1452  transform1D(
1453  TPoint3D(MAND_point.x, MAND_point.y, MAND_UTM.z), datum, MAND_point2);
1454  transform1D(
1455  TPoint3D(OROZ_point.x, OROZ_point.y, OROZ_UTM.z), datum, OROZ_point2);
1456  transform1D(
1457  TPoint3D(SANC_point.x, SANC_point.y, SANC_UTM.z), datum, SANC_point2);
1458  transform1D(
1459  TPoint3D(ARJO_point.x, ARJO_point.y, ARJO_UTM.z), datum, ARJO_point2);
1460  transform1D(
1461  TPoint3D(CANI_point.x, CANI_point.y, CANI_UTM.z), datum, CANI_point2);
1462  transform1D(
1463  TPoint3D(HALC_point.x, HALC_point.y, HALC_UTM.z), datum, HALC_point2);
1464 
1465  CVectorDouble thisResults;
1466  thisResults.resize(18);
1467 
1468  thisResults[0] = MAND_point2.x;
1469  thisResults[1] = MAND_point2.y;
1470  thisResults[2] = MAND_point2.z;
1471  thisResults[3] = OROZ_point2.x;
1472  thisResults[4] = OROZ_point2.y;
1473  thisResults[5] = OROZ_point2.z;
1474  thisResults[6] = SANC_point2.x;
1475  thisResults[7] = SANC_point2.y;
1476  thisResults[8] = SANC_point2.z;
1477  thisResults[9] = ARJO_point2.x;
1478  thisResults[10] = ARJO_point2.y;
1479  thisResults[11] = ARJO_point2.z;
1480  thisResults[12] = CANI_point2.x;
1481  thisResults[13] = CANI_point2.y;
1482  thisResults[14] = CANI_point2.z;
1483  thisResults[15] = HALC_point2.x;
1484  thisResults[16] = HALC_point2.y;
1485  thisResults[17] = HALC_point2.z;
1486 
1487  displayResults(thisResults, 12, true);
1488 }
1489 
1490 void Examples_13()
1491 {
1492  TGeodeticCoords MAND_92633(
1493  TCoords(37, 53, 33.072573).getDecimalValue(),
1494  TCoords(-3, 43, 52.68965).getDecimalValue(), 515.579);
1495  TGeodeticCoords OROZ_96965(
1496  TCoords(37, 35, 31.75505).getDecimalValue(),
1497  TCoords(-3, 38, 5.70754).getDecimalValue(), 1489.188);
1498  TGeodeticCoords SANC_94744(
1499  TCoords(37, 44, 29.04253).getDecimalValue(),
1500  TCoords(-3, 43, 12.90285).getDecimalValue(), 1054.189);
1501  TGeodeticCoords ARJO_94633(
1502  TCoords(37, 43, 51.28918).getDecimalValue(),
1503  TCoords(-4, 3, 48.64503).getDecimalValue(), 569.182);
1504  TGeodeticCoords CANI_96833(
1505  TCoords(37, 33, 6.94237).getDecimalValue(),
1506  TCoords(-4, 3, 28.81611).getDecimalValue(), 897.626);
1507  TGeodeticCoords HALC_92543(
1508  TCoords(37, 53, 11.26838).getDecimalValue(),
1509  TCoords(-4, 2, 44.35794).getDecimalValue(), 530.446);
1510 
1511  const TEllipsoid ellip = TEllipsoid::Ellipsoid_Hayford_1909();
1512 
1513  // A2
1514  int UTMZone;
1515  char UTMBand;
1516  TUTMCoords MAND_UTM, OROZ_UTM, SANC_UTM, ARJO_UTM, CANI_UTM, HALC_UTM;
1517  geodeticToUTM(MAND_92633, MAND_UTM, UTMZone, UTMBand, ellip);
1518  geodeticToUTM(OROZ_96965, OROZ_UTM, UTMZone, UTMBand, ellip);
1519  geodeticToUTM(SANC_94744, SANC_UTM, UTMZone, UTMBand, ellip);
1520  geodeticToUTM(ARJO_94633, ARJO_UTM, UTMZone, UTMBand, ellip);
1521  geodeticToUTM(CANI_96833, CANI_UTM, UTMZone, UTMBand, ellip);
1522  geodeticToUTM(HALC_92543, HALC_UTM, UTMZone, UTMBand, ellip);
1523 
1524  // A10
1525  TPoint3D MAND_point, OROZ_point, SANC_point, ARJO_point, CANI_point,
1526  HALC_point;
1528  423150.0514, 4197393.9437, -334.2393 /*ppm*/, -314.2785 /*ppm*/,
1529  1.33958 /*secs*/);
1530  transfInterpolation(MAND_UTM, dat, MAND_point);
1531  transfInterpolation(OROZ_UTM, dat, OROZ_point);
1532  transfInterpolation(SANC_UTM, dat, SANC_point);
1533  transfInterpolation(ARJO_UTM, dat, ARJO_point);
1534  transfInterpolation(CANI_UTM, dat, CANI_point);
1535  transfInterpolation(HALC_UTM, dat, HALC_point);
1536 
1537  // A9
1538  TPoint3D MAND_point2, OROZ_point2, SANC_point2, ARJO_point2, CANI_point2,
1539  HALC_point2;
1540  TDatum1DTransf datum(-0.00001822 /*rad*/, -0.00001304 /*rad*/, -49.8094, 0);
1541  transform1D(MAND_point, datum, MAND_point2);
1542  transform1D(OROZ_point, datum, OROZ_point2);
1543  transform1D(SANC_point, datum, SANC_point2);
1544  transform1D(ARJO_point, datum, ARJO_point2);
1545  transform1D(CANI_point, datum, CANI_point2);
1546  transform1D(HALC_point, datum, HALC_point2);
1547 
1548  CVectorDouble thisResults;
1549  thisResults.resize(18);
1550 
1551  thisResults[0] = MAND_point2.x;
1552  thisResults[1] = MAND_point2.y;
1553  thisResults[2] = MAND_point2.z;
1554  thisResults[3] = OROZ_point2.x;
1555  thisResults[4] = OROZ_point2.y;
1556  thisResults[5] = OROZ_point2.z;
1557  thisResults[6] = SANC_point2.x;
1558  thisResults[7] = SANC_point2.y;
1559  thisResults[8] = SANC_point2.z;
1560  thisResults[9] = ARJO_point2.x;
1561  thisResults[10] = ARJO_point2.y;
1562  thisResults[11] = ARJO_point2.z;
1563  thisResults[12] = CANI_point2.x;
1564  thisResults[13] = CANI_point2.y;
1565  thisResults[14] = CANI_point2.z;
1566  thisResults[15] = HALC_point2.x;
1567  thisResults[16] = HALC_point2.y;
1568  thisResults[17] = HALC_point2.z;
1569 
1570  displayResults(thisResults, 13, true);
1571 }
1572 
1573 int main(int argc, char** argv)
1574 {
1575  try
1576  {
1577  exampleResults();
1580  cout << "**************************************" << endl;
1581  cout << "\tTOPCON with th = " << TH << endl;
1582  cout << "**************************************" << endl;
1584  Examples_01();
1585  Examples_02();
1586  Examples_03();
1587  Examples_04();
1588  Examples_05();
1589  Examples_06();
1590  Examples_07();
1591  Examples_08();
1593  cout << "**************************************" << endl;
1594  cout << "\tLEICA with th = " << TH << endl;
1595  cout << "**************************************" << endl;
1597  cout << "Example 09 missing in pdf" << endl;
1598  Examples_10();
1599  Examples_11();
1600  Examples_12();
1601  Examples_13();
1602 
1603  return 0;
1604  }
1605  catch (std::exception& e)
1606  {
1607  std::cout << "MRPT exception caught: " << e.what() << std::endl;
1608  return -1;
1609  }
1610  catch (...)
1611  {
1612  printf("Another exception!!");
1613  return -1;
1614  }
1615 }
os.h
mrpt::topography::TEllipsoid::name
std::string name
the ellipsoid name
Definition: data_types.h:96
TH
const double TH
Definition: vision_stereo_rectify/test.cpp:25
mrpt::math::TPoint2D::y
double y
Definition: lightweight_geom_data.h:49
Examples_12
void Examples_12()
Definition: vision_stereo_rectify/test.cpp:1401
mrpt::topography::TDatumHelmert2D
Parameters for a topographic transfomation.
Definition: data_types.h:304
mrpt::math::dynamic_vector
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
Definition: eigen_frwds.h:44
displayResults
void displayResults(const CVectorDouble &thisResults, const unsigned int &example, const bool color)
Definition: vision_stereo_rectify/test.cpp:291
mrpt::system::CONCOL_GREEN
@ CONCOL_GREEN
Definition: os.h:179
mrpt::topography::TDatumTransfInterpolation
Parameters for a topographic transfomation.
Definition: data_types.h:393
mrpt::topography::transform1D
void transform1D(const mrpt::math::TPoint3D &p, const TDatum1DTransf &d, mrpt::math::TPoint3D &o)
1D transformation: [ Z ]_WGS84 = (dy * X - dx * Y + Z)*(1+e)+DZ
Definition: conversions.cpp:627
mrpt::topography::TDatumHelmert2D_TOPCON
Definition: data_types.h:322
Examples_08
void Examples_08()
Definition: vision_stereo_rectify/test.cpp:1089
Examples_01
void Examples_01()
Definition: vision_stereo_rectify/test.cpp:455
Examples_07
void Examples_07()
Definition: vision_stereo_rectify/test.cpp:964
mrpt::topography::TDatumHelmert3D_TOPCON
Parameters for a topographic transfomation.
Definition: data_types.h:360
mrpt::math::TPoint3D::z
double z
Definition: lightweight_geom_data.h:385
topography.h
mrpt::math::TPoint2D::x
double x
X,Y coordinates.
Definition: lightweight_geom_data.h:49
mrpt::system::CONCOL_BLUE
@ CONCOL_BLUE
Definition: os.h:178
mrpt::topography::TDatum7Params_TOPCON
Definition: data_types.h:244
Examples_13
void Examples_13()
Definition: vision_stereo_rectify/test.cpp:1490
mrpt::system::CONCOL_RED
@ CONCOL_RED
Definition: os.h:180
Examples_06
void Examples_06()
Definition: vision_stereo_rectify/test.cpp:834
mrpt::topography::transformHelmert2D_TOPCON
void transformHelmert2D_TOPCON(const mrpt::math::TPoint2D &p, const TDatumHelmert2D_TOPCON &d, mrpt::math::TPoint2D &o)
Helmert 2D transformation: [ X Y ]_WGS84 = [ dX dY ] + ( 1 + dS ) [ cos(alpha) -sin(alpha); sin(alpha...
Definition: conversions.cpp:588
mrpt::topography::geodeticToUTM
void geodeticToUTM(const TGeodeticCoords &GeodeticCoords, TUTMCoords &UTMCoords, int &UTMZone, char &UTMLatitudeBand, const TEllipsoid &ellip=TEllipsoid::Ellipsoid_WGS84())
Definition: conversions.cpp:333
mrpt::topography::TGeodeticCoords::lon
TCoords lon
Longitude (in degrees)
Definition: data_types.h:212
results
map< string, CVectorDouble > results
Definition: vision_stereo_rectify/test.cpp:33
main
int main()
Definition: vision_stereo_rectify/test.cpp:78
Examples_02
void Examples_02()
Definition: vision_stereo_rectify/test.cpp:518
mrpt::topography::transformHelmert3D_TOPCON
void transformHelmert3D_TOPCON(const mrpt::math::TPoint3D &p, const TDatumHelmert3D_TOPCON &d, mrpt::math::TPoint3D &o)
Helmert 3D transformation: [ X Y ]_WGS84 = [ dX dY ] + ( 1 + dS ) [ cos(alpha) -sin(alpha); sin(alpha...
Definition: conversions.cpp:614
get_unsafe
EIGEN_STRONG_INLINE Scalar get_unsafe(const size_t row, const size_t col) const
Read-only access to one element (Use with caution, bounds are not checked!)
Definition: eigen_plugins.h:104
mrpt::topography::TGeodeticCoords
A set of geodetic coordinates: latitude, longitude and height, defined over a given geoid (typically,...
Definition: data_types.h:195
mrpt::topography::TDatum10Params
Parameters for a topographic transfomation.
Definition: data_types.h:277
mrpt::math::TPoint3D::x
double x
X,Y,Z coordinates.
Definition: lightweight_geom_data.h:385
Examples_04
void Examples_04()
Definition: vision_stereo_rectify/test.cpp:687
mrpt::topography::UTMToGeodetic
void UTMToGeodetic(double X, double Y, int zone, char hem, double &out_lon, double &out_lat, const TEllipsoid &ellip=TEllipsoid::Ellipsoid_WGS84())
Returns the Geodetic coordinates of the UTM input point.
Definition: conversions.cpp:289
exampleResults
void exampleResults()
Definition: vision_stereo_rectify/test.cpp:27
color
GLuint color
Definition: glext.h:8300
Examples_11
void Examples_11()
Definition: vision_stereo_rectify/test.cpp:1309
mrpt::math::TPoint2D
Lightweight 2D point.
Definition: lightweight_geom_data.h:42
mrpt::system::CONCOL_NORMAL
@ CONCOL_NORMAL
Definition: os.h:177
mrpt::topography::transformHelmert2D
void transformHelmert2D(const mrpt::math::TPoint2D &p, const TDatumHelmert2D &d, mrpt::math::TPoint2D &o)
Helmert 2D transformation: [ X Y ]_WGS84 = [ dX dY ] + ( 1 + dS ) [ cos(alpha) -sin(alpha); sin(alpha...
Definition: conversions.cpp:570
names
std::vector< string > names
Definition: vision_stereo_rectify/test.cpp:23
CMatrixD.h
Examples_03
void Examples_03()
Definition: vision_stereo_rectify/test.cpp:609
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::topography::TEllipsoid
Definition: data_types.h:82
mrpt::topography::TGeodeticCoords::height
double height
Geodetic height (in meters)
Definition: data_types.h:214
mrpt::math::TPoint3D::y
double y
Definition: lightweight_geom_data.h:385
mrpt::topography::TDatum1DTransf
Parameters for a topographic transfomation.
Definition: data_types.h:375
mrpt::topography::transform7params
void transform7params(const mrpt::math::TPoint3D &in_point, const TDatum7Params &in_datum, mrpt::math::TPoint3D &out_point)
7-parameter Bursa-Wolf transformation: [ X Y Z ]_WGS84 = [ dX dY dZ ] + ( 1 + dS ) [ 1 RZ -RY; -RZ 1 ...
Definition: conversions.cpp:518
Examples_05
void Examples_05()
Definition: vision_stereo_rectify/test.cpp:760
mrpt::topography::transfInterpolation
void transfInterpolation(const mrpt::math::TPoint3D &p, const TDatumTransfInterpolation &d, mrpt::math::TPoint3D &o)
Interpolation: [ Z ]_WGS84 = (dy * X - dx * Y + Z)*(1+e)+DZ.
Definition: conversions.cpp:641
mrpt::topography::transform7params_TOPCON
void transform7params_TOPCON(const mrpt::math::TPoint3D &in_point, const TDatum7Params_TOPCON &in_datum, mrpt::math::TPoint3D &out_point)
7-parameter Bursa-Wolf transformation TOPCON: [ X Y Z ]_WGS84 = [ dX dY dZ ] + ( 1 + dS ) [ 1 RZ -RY;...
Definition: conversions.cpp:534
mrpt::topography::transform10params
void transform10params(const mrpt::math::TPoint3D &in_point, const TDatum10Params &in_datum, mrpt::math::TPoint3D &out_point)
10-parameter Molodensky-Badekas transformation: [ X Y Z ]_WGS84 = [ dX dY dZ ] + ( 1 + dS ) [ 1 RZ -R...
Definition: conversions.cpp:550
mrpt::topography
This namespace provides topography helper functions, coordinate transformations.
Definition: conversions.h:22
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:13
mrpt::math::CMatrixD
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>".
Definition: CMatrixD.h:24
mrpt::topography::geocentricToGeodetic
void geocentricToGeodetic(const TGeocentricCoords &in_point, TGeodeticCoords &out_coords, const TEllipsoid &ellip=TEllipsoid::Ellipsoid_WGS84())
Coordinates transformation from geocentric X/Y/Z coordinates to longitude/latitude/height.
Definition: conversions.cpp:259
mrpt::topography::geodeticToGeocentric
void geodeticToGeocentric(const TGeodeticCoords &in_coords, TGeocentricCoords &out_point, const TEllipsoid &ellip)
Coordinates transformation from longitude/latitude/height to geocentric X/Y/Z coordinates (with an sp...
Definition: conversions.cpp:228
mrpt::system::setConsoleColor
void setConsoleColor(TConsoleColor color, bool changeStdErr=false)
Changes the text color in the console for the text written from now on.
Definition: os.cpp:480
mrpt::topography::TDatum7Params
Parameters for a topographic transfomation.
Definition: data_types.h:223
mrpt::topography::TCoords
A coordinate that is stored as a simple "decimal" angle in degrees, but can be retrieved/set in the f...
Definition: data_types.h:27
Examples_10
void Examples_10()
Definition: vision_stereo_rectify/test.cpp:1218
mrpt::topography::TGeodeticCoords::lat
TCoords lat
Latitude (in degrees)
Definition: data_types.h:210
mrpt::system
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Definition: math_frwds.h:25
TestCoordinatesConversions
void TestCoordinatesConversions()
Definition: vision_stereo_rectify/test.cpp:351



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST