A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
geo-to-cartesian-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Benjamin Cizdziel <ben.cizdziel@gmail.com>
7 */
8
9#include <ns3/geographic-positions.h>
10#include <ns3/log.h>
11#include <ns3/test.h>
12
13NS_LOG_COMPONENT_DEFINE("GeoToCartesianTest");
14
15using namespace ns3;
16
17// 10 meter tolerance for testing, which is very small with respect to ECEF
18// Cartesian coordinates on or above earth's surface
19const double TOLERANCE = 10;
20
21const double XSPHERE_MATLAB[216] = {
22 6371000, 1968747.27116279, -5154247.27116279, -5154247.27116279, 1968747.27116279,
23 6371000, 1968747.27116279, 608376.364418605, -1592750, -1592750.00000000,
24 608376.364418605, 1968747.27116279, -5154247.27116279, -1592750, 4169873.63558139,
25 4169873.63558139, -1592750.00000000, -5154247.27116279, -5154247.27116279, -1592750.00000000,
26 4169873.63558139, 4169873.63558140, -1592750.00000000, -5154247.27116279, 1968747.27116279,
27 608376.364418605, -1592750.00000000, -1592750.00000000, 608376.364418604, 1968747.27116279,
28 6371000, 1968747.27116279, -5154247.27116279, -5154247.27116279, 1968747.27116279,
29 6371000, 6371200, 1968809.07456167, -5154409.07456167, -5154409.07456167,
30 1968809.07456166, 6371200, 1968809.07456167, 608395.462719168, -1592800,
31 -1592800.00000000, 608395.462719167, 1968809.07456167, -5154409.07456167, -1592800,
32 4170004.53728083, 4170004.53728083, -1592800.00000000, -5154409.07456167, -5154409.07456167,
33 -1592800, 4170004.53728083, 4170004.53728083, -1592800.00000000, -5154409.07456167,
34 1968809.07456166, 608395.462719167, -1592800.00000000, -1592800.00000000, 608395.462719167,
35 1968809.07456166, 6371200, 1968809.07456167, -5154409.07456167, -5154409.07456167,
36 1968809.07456166, 6371200, 6371400, 1968870.87796054, -5154570.87796054,
37 -5154570.87796054, 1968870.87796054, 6371400, 1968870.87796054, 608414.561019730,
38 -1592850, -1592850.00000000, 608414.561019730, 1968870.87796054, -5154570.87796054,
39 -1592850, 4170135.43898027, 4170135.43898027, -1592850.00000000, -5154570.87796054,
40 -5154570.87796054, -1592850.00000000, 4170135.43898027, 4170135.43898027, -1592850.00000000,
41 -5154570.87796054, 1968870.87796054, 608414.561019730, -1592850.00000000, -1592850.00000000,
42 608414.561019729, 1968870.87796054, 6371400, 1968870.87796054, -5154570.87796054,
43 -5154570.87796054, 1968870.87796054, 6371400, 6371600, 1968932.68135942,
44 -5154732.68135941, -5154732.68135942, 1968932.68135941, 6371600, 1968932.68135942,
45 608433.659320293, -1592900, -1592900.00000000, 608433.659320292, 1968932.68135942,
46 -5154732.68135941, -1592900.00000000, 4170266.34067971, 4170266.34067971, -1592900.00000000,
47 -5154732.68135941, -5154732.68135942, -1592900.00000000, 4170266.34067971, 4170266.34067971,
48 -1592900.00000000, -5154732.68135942, 1968932.68135941, 608433.659320292, -1592900.00000000,
49 -1592900.00000000, 608433.659320292, 1968932.68135941, 6371600, 1968932.68135942,
50 -5154732.68135941, -5154732.68135942, 1968932.68135941, 6371600, 6371800,
51 1968994.48475829, -5154894.48475829, -5154894.48475829, 1968994.48475829, 6371800,
52 1968994.48475829, 608452.757620855, -1592950, -1592950.00000000, 608452.757620855,
53 1968994.48475829, -5154894.48475829, -1592950, 4170397.24237914, 4170397.24237914,
54 -1592950.00000000, -5154894.48475829, -5154894.48475829, -1592950.00000000, 4170397.24237914,
55 4170397.24237915, -1592950.00000000, -5154894.48475829, 1968994.48475829, 608452.757620855,
56 -1592950.00000000, -1592950.00000000, 608452.757620854, 1968994.48475829, 6371800,
57 1968994.48475829, -5154894.48475829, -5154894.48475829, 1968994.48475829, 6371800,
58 6372000, 1969056.28815717, -5155056.28815716, -5155056.28815717, 1969056.28815716,
59 6372000, 1969056.28815717, 608471.855921418, -1593000, -1593000,
60 608471.855921417, 1969056.28815717, -5155056.28815716, -1593000.00000000, 4170528.14407858,
61 4170528.14407858, -1593000.00000000, -5155056.28815716, -5155056.28815717, -1593000.00000000,
62 4170528.14407858, 4170528.14407858, -1593000.00000000, -5155056.28815717, 1969056.28815716,
63 608471.855921417, -1593000.00000000, -1593000.00000000, 608471.855921417, 1969056.28815716,
64 6372000, 1969056.28815717, -5155056.28815716, -5155056.28815717, 1969056.28815716,
65 6372000,
66};
67
68const double YSPHERE_MATLAB[216] = {
69 0,
70 6059181.06531642,
71 3744779.84235535,
72 -3744779.84235535,
73 -6059181.06531642,
74 -1.56044495147356e-09,
75 0,
76 1872389.92117767,
77 1157200.61148054,
78 -1157200.61148054,
79 -1872389.92117767,
80 -4.82204008791920e-10,
81 0,
82 -4901980.45383588,
83 -3029590.53265821,
84 3029590.53265821,
85 4901980.45383588,
86 1.26242648452870e-09,
87 0,
88 -4901980.45383589,
89 -3029590.53265821,
90 3029590.53265821,
91 4901980.45383589,
92 1.26242648452870e-09,
93 0,
94 1872389.92117767,
95 1157200.61148054,
96 -1157200.61148054,
97 -1872389.92117767,
98 -4.82204008791919e-10,
99 0,
100 6059181.06531642,
101 3744779.84235535,
102 -3744779.84235535,
103 -6059181.06531642,
104 -1.56044495147356e-09,
105 0,
106 6059371.27661968,
107 3744897.39940581,
108 -3744897.39940580,
109 -6059371.27661968,
110 -1.56049393734552e-09,
111 0,
112 1872448.69970290,
113 1157236.93860694,
114 -1157236.93860694,
115 -1872448.69970290,
116 -4.82219146258841e-10,
117 0,
118 -4902134.33801274,
119 -3029685.63830984,
120 3029685.63830984,
121 4902134.33801274,
122 1.26246611493160e-09,
123 0,
124 -4902134.33801274,
125 -3029685.63830984,
126 3029685.63830984,
127 4902134.33801274,
128 1.26246611493160e-09,
129 0,
130 1872448.69970290,
131 1157236.93860694,
132 -1157236.93860694,
133 -1872448.69970290,
134 -4.82219146258841e-10,
135 0,
136 6059371.27661968,
137 3744897.39940581,
138 -3744897.39940580,
139 -6059371.27661968,
140 -1.56049393734552e-09,
141 0,
142 6059561.48792294,
143 3745014.95645626,
144 -3745014.95645626,
145 -6059561.48792294,
146 -1.56054292321749e-09,
147 0,
148 1872507.47822813,
149 1157273.26573334,
150 -1157273.26573334,
151 -1872507.47822813,
152 -4.82234283725763e-10,
153 0,
154 -4902288.22218960,
155 -3029780.74396147,
156 3029780.74396147,
157 4902288.22218960,
158 1.26250574533451e-09,
159 0,
160 -4902288.22218960,
161 -3029780.74396147,
162 3029780.74396147,
163 4902288.22218960,
164 1.26250574533451e-09,
165 0,
166 1872507.47822813,
167 1157273.26573334,
168 -1157273.26573334,
169 -1872507.47822813,
170 -4.82234283725763e-10,
171 0,
172 6059561.48792294,
173 3745014.95645626,
174 -3745014.95645626,
175 -6059561.48792294,
176 -1.56054292321749e-09,
177 0,
178 6059751.69922620,
179 3745132.51350672,
180 -3745132.51350672,
181 -6059751.69922620,
182 -1.56059190908946e-09,
183 0,
184 1872566.25675336,
185 1157309.59285974,
186 -1157309.59285974,
187 -1872566.25675336,
188 -4.82249421192685e-10,
189 0,
190 -4902442.10636646,
191 -3029875.84961310,
192 3029875.84961310,
193 4902442.10636646,
194 1.26254537573741e-09,
195 0,
196 -4902442.10636646,
197 -3029875.84961310,
198 3029875.84961310,
199 4902442.10636646,
200 1.26254537573741e-09,
201 0,
202 1872566.25675336,
203 1157309.59285974,
204 -1157309.59285974,
205 -1872566.25675336,
206 -4.82249421192684e-10,
207 0,
208 6059751.69922620,
209 3745132.51350672,
210 -3745132.51350672,
211 -6059751.69922620,
212 -1.56059190908946e-09,
213 0,
214 6059941.91052946,
215 3745250.07055718,
216 -3745250.07055718,
217 -6059941.91052946,
218 -1.56064089496142e-09,
219 0,
220 1872625.03527859,
221 1157345.91998614,
222 -1157345.91998614,
223 -1872625.03527859,
224 -4.82264558659606e-10,
225 0,
226 -4902595.99054332,
227 -3029970.95526473,
228 3029970.95526473,
229 4902595.99054332,
230 1.26258500614032e-09,
231 0,
232 -4902595.99054332,
233 -3029970.95526473,
234 3029970.95526473,
235 4902595.99054332,
236 1.26258500614032e-09,
237 0,
238 1872625.03527859,
239 1157345.91998614,
240 -1157345.91998614,
241 -1872625.03527859,
242 -4.82264558659606e-10,
243 0,
244 6059941.91052946,
245 3745250.07055718,
246 -3745250.07055718,
247 -6059941.91052946,
248 -1.56064089496142e-09,
249 0,
250 6060132.12183272,
251 3745367.62760764,
252 -3745367.62760764,
253 -6060132.12183272,
254 -1.56068988083339e-09,
255 0,
256 1872683.81380382,
257 1157382.24711254,
258 -1157382.24711254,
259 -1872683.81380382,
260 -4.82279696126528e-10,
261 0,
262 -4902749.87472018,
263 -3030066.06091636,
264 3030066.06091636,
265 4902749.87472018,
266 1.26262463654322e-09,
267 0,
268 -4902749.87472018,
269 -3030066.06091636,
270 3030066.06091636,
271 4902749.87472018,
272 1.26262463654322e-09,
273 0,
274 1872683.81380382,
275 1157382.24711254,
276 -1157382.24711254,
277 -1872683.81380382,
278 -4.82279696126528e-10,
279 0,
280 6060132.12183272,
281 3745367.62760764,
282 -3745367.62760764,
283 -6060132.12183272,
284 -1.56068988083339e-09,
285};
286
287const double ZSPHERE_MATLAB[216] = {
288 0,
289 0,
290 0,
291 0,
292 0,
293 0,
294 6059181.06531642,
295 6059181.06531642,
296 6059181.06531642,
297 6059181.06531642,
298 6059181.06531642,
299 6059181.06531642,
300 3744779.84235535,
301 3744779.84235535,
302 3744779.84235535,
303 3744779.84235535,
304 3744779.84235535,
305 3744779.84235535,
306 -3744779.84235535,
307 -3744779.84235535,
308 -3744779.84235535,
309 -3744779.84235535,
310 -3744779.84235535,
311 -3744779.84235535,
312 -6059181.06531642,
313 -6059181.06531642,
314 -6059181.06531642,
315 -6059181.06531642,
316 -6059181.06531642,
317 -6059181.06531642,
318 -1.56044495147356e-09,
319 -1.56044495147356e-09,
320 -1.56044495147356e-09,
321 -1.56044495147356e-09,
322 -1.56044495147356e-09,
323 -1.56044495147356e-09,
324 0,
325 0,
326 0,
327 0,
328 0,
329 0,
330 6059371.27661968,
331 6059371.27661968,
332 6059371.27661968,
333 6059371.27661968,
334 6059371.27661968,
335 6059371.27661968,
336 3744897.39940581,
337 3744897.39940581,
338 3744897.39940581,
339 3744897.39940581,
340 3744897.39940581,
341 3744897.39940581,
342 -3744897.39940580,
343 -3744897.39940580,
344 -3744897.39940580,
345 -3744897.39940580,
346 -3744897.39940580,
347 -3744897.39940580,
348 -6059371.27661968,
349 -6059371.27661968,
350 -6059371.27661968,
351 -6059371.27661968,
352 -6059371.27661968,
353 -6059371.27661968,
354 -1.56049393734552e-09,
355 -1.56049393734552e-09,
356 -1.56049393734552e-09,
357 -1.56049393734552e-09,
358 -1.56049393734552e-09,
359 -1.56049393734552e-09,
360 0,
361 0,
362 0,
363 0,
364 0,
365 0,
366 6059561.48792294,
367 6059561.48792294,
368 6059561.48792294,
369 6059561.48792294,
370 6059561.48792294,
371 6059561.48792294,
372 3745014.95645626,
373 3745014.95645626,
374 3745014.95645626,
375 3745014.95645626,
376 3745014.95645626,
377 3745014.95645626,
378 -3745014.95645626,
379 -3745014.95645626,
380 -3745014.95645626,
381 -3745014.95645626,
382 -3745014.95645626,
383 -3745014.95645626,
384 -6059561.48792294,
385 -6059561.48792294,
386 -6059561.48792294,
387 -6059561.48792294,
388 -6059561.48792294,
389 -6059561.48792294,
390 -1.56054292321749e-09,
391 -1.56054292321749e-09,
392 -1.56054292321749e-09,
393 -1.56054292321749e-09,
394 -1.56054292321749e-09,
395 -1.56054292321749e-09,
396 0,
397 0,
398 0,
399 0,
400 0,
401 0,
402 6059751.69922620,
403 6059751.69922620,
404 6059751.69922620,
405 6059751.69922620,
406 6059751.69922620,
407 6059751.69922620,
408 3745132.51350672,
409 3745132.51350672,
410 3745132.51350672,
411 3745132.51350672,
412 3745132.51350672,
413 3745132.51350672,
414 -3745132.51350672,
415 -3745132.51350672,
416 -3745132.51350672,
417 -3745132.51350672,
418 -3745132.51350672,
419 -3745132.51350672,
420 -6059751.69922620,
421 -6059751.69922620,
422 -6059751.69922620,
423 -6059751.69922620,
424 -6059751.69922620,
425 -6059751.69922620,
426 -1.56059190908946e-09,
427 -1.56059190908946e-09,
428 -1.56059190908946e-09,
429 -1.56059190908946e-09,
430 -1.56059190908946e-09,
431 -1.56059190908946e-09,
432 0,
433 0,
434 0,
435 0,
436 0,
437 0,
438 6059941.91052946,
439 6059941.91052946,
440 6059941.91052946,
441 6059941.91052946,
442 6059941.91052946,
443 6059941.91052946,
444 3745250.07055718,
445 3745250.07055718,
446 3745250.07055718,
447 3745250.07055718,
448 3745250.07055718,
449 3745250.07055718,
450 -3745250.07055718,
451 -3745250.07055718,
452 -3745250.07055718,
453 -3745250.07055718,
454 -3745250.07055718,
455 -3745250.07055718,
456 -6059941.91052946,
457 -6059941.91052946,
458 -6059941.91052946,
459 -6059941.91052946,
460 -6059941.91052946,
461 -6059941.91052946,
462 -1.56064089496142e-09,
463 -1.56064089496142e-09,
464 -1.56064089496142e-09,
465 -1.56064089496142e-09,
466 -1.56064089496142e-09,
467 -1.56064089496142e-09,
468 0,
469 0,
470 0,
471 0,
472 0,
473 0,
474 6060132.12183272,
475 6060132.12183272,
476 6060132.12183272,
477 6060132.12183272,
478 6060132.12183272,
479 6060132.12183272,
480 3745367.62760764,
481 3745367.62760764,
482 3745367.62760764,
483 3745367.62760764,
484 3745367.62760764,
485 3745367.62760764,
486 -3745367.62760764,
487 -3745367.62760764,
488 -3745367.62760764,
489 -3745367.62760764,
490 -3745367.62760764,
491 -3745367.62760764,
492 -6060132.12183272,
493 -6060132.12183272,
494 -6060132.12183272,
495 -6060132.12183272,
496 -6060132.12183272,
497 -6060132.12183272,
498 -1.56068988083339e-09,
499 -1.56068988083339e-09,
500 -1.56068988083339e-09,
501 -1.56068988083339e-09,
502 -1.56068988083339e-09,
503 -1.56068988083339e-09,
504};
505
506const double XGRS80_MATLAB[216] = {
507 6378137, 1970952.72545164, -5160021.22545164, -5160021.22545164, 1970952.72545164,
508 6378137, 1976947.14312992, 610910.264208145, -1599383.83577310, -1599383.83577310,
509 610910.264208145, 1976947.14312992, -5165998.77753988, -1596381.41518003, 4179380.80394997,
510 4179380.80394997, -1596381.41518003, -5165998.77753988, -5165998.77753988, -1596381.41518003,
511 4179380.80394997, 4179380.80394997, -1596381.41518003, -5165998.77753988, 1976947.14312991,
512 610910.264208145, -1599383.83577310, -1599383.83577310, 610910.264208145, 1976947.14312991,
513 6378137, 1970952.72545164, -5160021.22545164, -5160021.22545164, 1970952.72545164,
514 6378137, 6378337, 1971014.52885052, -5160183.02885052, -5160183.02885052,
515 1971014.52885052, 6378337, 1977008.94652879, 610929.362508708, -1599433.83577310,
516 -1599433.83577310, 610929.362508708, 1977008.94652879, -5166160.58093876, -1596431.41518003,
517 4179511.70564940, 4179511.70564940, -1596431.41518003, -5166160.58093876, -5166160.58093876,
518 -1596431.41518003, 4179511.70564940, 4179511.70564940, -1596431.41518003, -5166160.58093876,
519 1977008.94652879, 610929.362508708, -1599433.83577310, -1599433.83577310, 610929.362508707,
520 1977008.94652879, 6378337, 1971014.52885052, -5160183.02885052, -5160183.02885052,
521 1971014.52885052, 6378337, 6378537, 1971076.33224939, -5160344.83224939,
522 -5160344.83224940, 1971076.33224939, 6378537, 1977070.74992767, 610948.460809271,
523 -1599483.83577310, -1599483.83577310, 610948.460809270, 1977070.74992767, -5166322.38433763,
524 -1596481.41518003, 4179642.60734884, 4179642.60734884, -1596481.41518003, -5166322.38433763,
525 -5166322.38433763, -1596481.41518003, 4179642.60734884, 4179642.60734884, -1596481.41518003,
526 -5166322.38433763, 1977070.74992766, 610948.460809270, -1599483.83577310, -1599483.83577310,
527 610948.460809270, 1977070.74992766, 6378537, 1971076.33224939, -5160344.83224939,
528 -5160344.83224940, 1971076.33224939, 6378537, 6378737, 1971138.13564827,
529 -5160506.63564827, -5160506.63564827, 1971138.13564827, 6378737, 1977132.55332654,
530 610967.559109833, -1599533.83577310, -1599533.83577310, 610967.559109833, 1977132.55332654,
531 -5166484.18773651, -1596531.41518003, 4179773.50904828, 4179773.50904828, -1596531.41518003,
532 -5166484.18773651, -5166484.18773651, -1596531.41518003, 4179773.50904828, 4179773.50904828,
533 -1596531.41518003, -5166484.18773651, 1977132.55332654, 610967.559109833, -1599533.83577310,
534 -1599533.83577310, 610967.559109832, 1977132.55332654, 6378737, 1971138.13564827,
535 -5160506.63564827, -5160506.63564827, 1971138.13564827, 6378737, 6378937,
536 1971199.93904714, -5160668.43904714, -5160668.43904714, 1971199.93904714, 6378937,
537 1977194.35672542, 610986.657410395, -1599583.83577310, -1599583.83577310, 610986.657410395,
538 1977194.35672542, -5166645.99113538, -1596581.41518003, 4179904.41074772, 4179904.41074772,
539 -1596581.41518003, -5166645.99113538, -5166645.99113538, -1596581.41518003, 4179904.41074772,
540 4179904.41074772, -1596581.41518003, -5166645.99113538, 1977194.35672541, 610986.657410395,
541 -1599583.83577310, -1599583.83577310, 610986.657410395, 1977194.35672541, 6378937,
542 1971199.93904714, -5160668.43904714, -5160668.43904714, 1971199.93904714, 6378937,
543 6379137, 1971261.74244602, -5160830.24244602, -5160830.24244602, 1971261.74244602,
544 6379137, 1977256.16012429, 611005.755710958, -1599633.83577310, -1599633.83577310,
545 611005.755710958, 1977256.16012429, -5166807.79453425, -1596631.41518003, 4180035.31244715,
546 4180035.31244715, -1596631.41518003, -5166807.79453425, -5166807.79453426, -1596631.41518003,
547 4180035.31244715, 4180035.31244715, -1596631.41518003, -5166807.79453426, 1977256.16012429,
548 611005.755710958, -1599633.83577310, -1599633.83577310, 611005.755710957, 1977256.16012429,
549 6379137, 1971261.74244602, -5160830.24244602, -5160830.24244602, 1971261.74244602,
550 6379137,
551};
552
553const double YGRS80_MATLAB[216] = {
554 0,
555 6065968.75567322,
556 3748974.86570096,
557 -3748974.86570096,
558 -6065968.75567322,
559 -1.56219301231466e-09,
560 0,
561 1880188.46284479,
562 1162020.37529350,
563 -1162020.37529350,
564 -1880188.46284479,
565 -4.84212398183511e-10,
566 0,
567 -4913156.80055210,
568 -3036497.89479889,
569 3036497.89479889,
570 4913156.80055210,
571 1.26530477346267e-09,
572 0,
573 -4913156.80055210,
574 -3036497.89479889,
575 3036497.89479889,
576 4913156.80055210,
577 1.26530477346267e-09,
578 0,
579 1880188.46284479,
580 1162020.37529350,
581 -1162020.37529350,
582 -1880188.46284479,
583 -4.84212398183511e-10,
584 0,
585 6065968.75567322,
586 3748974.86570096,
587 -3748974.86570096,
588 -6065968.75567322,
589 -1.56219301231466e-09,
590 0,
591 6066158.96697648,
592 3749092.42275142,
593 -3749092.42275142,
594 -6066158.96697648,
595 -1.56224199818663e-09,
596 0,
597 1880247.24137002,
598 1162056.70241990,
599 -1162056.70241990,
600 -1880247.24137002,
601 -4.84227535650433e-10,
602 0,
603 -4913310.68472896,
604 -3036593.00045052,
605 3036593.00045051,
606 4913310.68472896,
607 1.26534440386558e-09,
608 0,
609 -4913310.68472896,
610 -3036593.00045052,
611 3036593.00045051,
612 4913310.68472896,
613 1.26534440386558e-09,
614 0,
615 1880247.24137002,
616 1162056.70241990,
617 -1162056.70241990,
618 -1880247.24137002,
619 -4.84227535650433e-10,
620 0,
621 6066158.96697648,
622 3749092.42275142,
623 -3749092.42275142,
624 -6066158.96697648,
625 -1.56224199818663e-09,
626 0,
627 6066349.17827974,
628 3749209.97980188,
629 -3749209.97980187,
630 -6066349.17827974,
631 -1.56229098405859e-09,
632 0,
633 1880306.01989525,
634 1162093.02954630,
635 -1162093.02954630,
636 -1880306.01989525,
637 -4.84242673117355e-10,
638 0,
639 -4913464.56890582,
640 -3036688.10610215,
641 3036688.10610214,
642 4913464.56890582,
643 1.26538403426848e-09,
644 0,
645 -4913464.56890582,
646 -3036688.10610215,
647 3036688.10610215,
648 4913464.56890582,
649 1.26538403426848e-09,
650 0,
651 1880306.01989525,
652 1162093.02954630,
653 -1162093.02954630,
654 -1880306.01989525,
655 -4.84242673117354e-10,
656 0,
657 6066349.17827974,
658 3749209.97980188,
659 -3749209.97980187,
660 -6066349.17827974,
661 -1.56229098405859e-09,
662 0,
663 6066539.38958300,
664 3749327.53685233,
665 -3749327.53685233,
666 -6066539.38958300,
667 -1.56233996993056e-09,
668 0,
669 1880364.79842048,
670 1162129.35667270,
671 -1162129.35667270,
672 -1880364.79842048,
673 -4.84257810584276e-10,
674 0,
675 -4913618.45308268,
676 -3036783.21175378,
677 3036783.21175377,
678 4913618.45308268,
679 1.26542366467138e-09,
680 0,
681 -4913618.45308268,
682 -3036783.21175378,
683 3036783.21175377,
684 4913618.45308268,
685 1.26542366467138e-09,
686 0,
687 1880364.79842048,
688 1162129.35667270,
689 -1162129.35667270,
690 -1880364.79842048,
691 -4.84257810584276e-10,
692 0,
693 6066539.38958300,
694 3749327.53685233,
695 -3749327.53685233,
696 -6066539.38958300,
697 -1.56233996993056e-09,
698 0,
699 6066729.60088626,
700 3749445.09390279,
701 -3749445.09390279,
702 -6066729.60088626,
703 -1.56238895580252e-09,
704 0,
705 1880423.57694571,
706 1162165.68379910,
707 -1162165.68379910,
708 -1880423.57694571,
709 -4.84272948051198e-10,
710 0,
711 -4913772.33725954,
712 -3036878.31740540,
713 3036878.31740540,
714 4913772.33725954,
715 1.26546329507429e-09,
716 0,
717 -4913772.33725954,
718 -3036878.31740541,
719 3036878.31740540,
720 4913772.33725954,
721 1.26546329507429e-09,
722 0,
723 1880423.57694571,
724 1162165.68379910,
725 -1162165.68379910,
726 -1880423.57694571,
727 -4.84272948051198e-10,
728 0,
729 6066729.60088626,
730 3749445.09390279,
731 -3749445.09390279,
732 -6066729.60088626,
733 -1.56238895580252e-09,
734 0,
735 6066919.81218952,
736 3749562.65095325,
737 -3749562.65095325,
738 -6066919.81218952,
739 -1.56243794167449e-09,
740 0,
741 1880482.35547094,
742 1162202.01092550,
743 -1162202.01092550,
744 -1880482.35547094,
745 -4.84288085518120e-10,
746 0,
747 -4913926.22143639,
748 -3036973.42305703,
749 3036973.42305703,
750 4913926.22143639,
751 1.26550292547719e-09,
752 0,
753 -4913926.22143639,
754 -3036973.42305703,
755 3036973.42305703,
756 4913926.22143639,
757 1.26550292547719e-09,
758 0,
759 1880482.35547094,
760 1162202.01092550,
761 -1162202.01092550,
762 -1880482.35547094,
763 -4.84288085518119e-10,
764 0,
765 6066919.81218952,
766 3749562.65095325,
767 -3749562.65095325,
768 -6066919.81218952,
769 -1.56243794167449e-09,
770};
771
772const double ZGRS80_MATLAB[216] = {
773 0,
774 0,
775 0,
776 0,
777 0,
778 0,
779 6043686.27213354,
780 6043686.27213354,
781 6043686.27213354,
782 6043686.27213354,
783 6043686.27213354,
784 6043686.27213354,
785 3728191.67572948,
786 3728191.67572948,
787 3728191.67572948,
788 3728191.67572948,
789 3728191.67572948,
790 3728191.67572948,
791 -3728191.67572948,
792 -3728191.67572948,
793 -3728191.67572948,
794 -3728191.67572948,
795 -3728191.67572948,
796 -3728191.67572948,
797 -6043686.27213354,
798 -6043686.27213354,
799 -6043686.27213354,
800 -6043686.27213354,
801 -6043686.27213354,
802 -6043686.27213354,
803 -1.55173509862111e-09,
804 -1.55173509862111e-09,
805 -1.55173509862111e-09,
806 -1.55173509862111e-09,
807 -1.55173509862111e-09,
808 -1.55173509862111e-09,
809 0,
810 0,
811 0,
812 0,
813 0,
814 0,
815 6043876.48343680,
816 6043876.48343680,
817 6043876.48343680,
818 6043876.48343680,
819 6043876.48343680,
820 6043876.48343680,
821 3728309.23277994,
822 3728309.23277994,
823 3728309.23277994,
824 3728309.23277994,
825 3728309.23277994,
826 3728309.23277994,
827 -3728309.23277994,
828 -3728309.23277994,
829 -3728309.23277994,
830 -3728309.23277994,
831 -3728309.23277994,
832 -3728309.23277994,
833 -6043876.48343680,
834 -6043876.48343680,
835 -6043876.48343680,
836 -6043876.48343680,
837 -6043876.48343680,
838 -6043876.48343680,
839 -1.55178408449307e-09,
840 -1.55178408449307e-09,
841 -1.55178408449307e-09,
842 -1.55178408449307e-09,
843 -1.55178408449307e-09,
844 -1.55178408449307e-09,
845 0,
846 0,
847 0,
848 0,
849 0,
850 0,
851 6044066.69474006,
852 6044066.69474006,
853 6044066.69474006,
854 6044066.69474006,
855 6044066.69474006,
856 6044066.69474006,
857 3728426.78983040,
858 3728426.78983040,
859 3728426.78983040,
860 3728426.78983040,
861 3728426.78983040,
862 3728426.78983040,
863 -3728426.78983040,
864 -3728426.78983040,
865 -3728426.78983040,
866 -3728426.78983040,
867 -3728426.78983040,
868 -3728426.78983040,
869 -6044066.69474006,
870 -6044066.69474006,
871 -6044066.69474006,
872 -6044066.69474006,
873 -6044066.69474006,
874 -6044066.69474006,
875 -1.55183307036504e-09,
876 -1.55183307036504e-09,
877 -1.55183307036504e-09,
878 -1.55183307036504e-09,
879 -1.55183307036504e-09,
880 -1.55183307036504e-09,
881 0,
882 0,
883 0,
884 0,
885 0,
886 0,
887 6044256.90604332,
888 6044256.90604332,
889 6044256.90604332,
890 6044256.90604332,
891 6044256.90604332,
892 6044256.90604332,
893 3728544.34688086,
894 3728544.34688086,
895 3728544.34688086,
896 3728544.34688086,
897 3728544.34688086,
898 3728544.34688086,
899 -3728544.34688086,
900 -3728544.34688086,
901 -3728544.34688086,
902 -3728544.34688086,
903 -3728544.34688086,
904 -3728544.34688086,
905 -6044256.90604332,
906 -6044256.90604332,
907 -6044256.90604332,
908 -6044256.90604332,
909 -6044256.90604332,
910 -6044256.90604332,
911 -1.55188205623700e-09,
912 -1.55188205623700e-09,
913 -1.55188205623700e-09,
914 -1.55188205623700e-09,
915 -1.55188205623700e-09,
916 -1.55188205623700e-09,
917 0,
918 0,
919 0,
920 0,
921 0,
922 0,
923 6044447.11734658,
924 6044447.11734658,
925 6044447.11734658,
926 6044447.11734658,
927 6044447.11734658,
928 6044447.11734658,
929 3728661.90393132,
930 3728661.90393132,
931 3728661.90393132,
932 3728661.90393132,
933 3728661.90393132,
934 3728661.90393132,
935 -3728661.90393132,
936 -3728661.90393132,
937 -3728661.90393132,
938 -3728661.90393132,
939 -3728661.90393132,
940 -3728661.90393132,
941 -6044447.11734658,
942 -6044447.11734658,
943 -6044447.11734658,
944 -6044447.11734658,
945 -6044447.11734658,
946 -6044447.11734658,
947 -1.55193104210897e-09,
948 -1.55193104210897e-09,
949 -1.55193104210897e-09,
950 -1.55193104210897e-09,
951 -1.55193104210897e-09,
952 -1.55193104210897e-09,
953 0,
954 0,
955 0,
956 0,
957 0,
958 0,
959 6044637.32864983,
960 6044637.32864983,
961 6044637.32864983,
962 6044637.32864983,
963 6044637.32864983,
964 6044637.32864983,
965 3728779.46098178,
966 3728779.46098178,
967 3728779.46098178,
968 3728779.46098178,
969 3728779.46098178,
970 3728779.46098178,
971 -3728779.46098177,
972 -3728779.46098177,
973 -3728779.46098177,
974 -3728779.46098177,
975 -3728779.46098177,
976 -3728779.46098177,
977 -6044637.32864983,
978 -6044637.32864983,
979 -6044637.32864983,
980 -6044637.32864983,
981 -6044637.32864983,
982 -6044637.32864983,
983 -1.55198002798094e-09,
984 -1.55198002798094e-09,
985 -1.55198002798094e-09,
986 -1.55198002798094e-09,
987 -1.55198002798094e-09,
988 -1.55198002798094e-09,
989};
990
991const double XWGS84_MATLAB[216] = {
992 6378137, 1970952.72545164, -5160021.22545164, -5160021.22545164, 1970952.72545164,
993 6378137, 1976947.14310045, 610910.264199039, -1599383.83574926, -1599383.83574926,
994 610910.264199039, 1976947.14310045, -5165998.77751058, -1596381.41517097, 4179380.80392626,
995 4179380.80392626, -1596381.41517097, -5165998.77751058, -5165998.77751058, -1596381.41517097,
996 4179380.80392626, 4179380.80392626, -1596381.41517097, -5165998.77751058, 1976947.14310045,
997 610910.264199039, -1599383.83574926, -1599383.83574926, 610910.264199039, 1976947.14310045,
998 6378137, 1970952.72545164, -5160021.22545164, -5160021.22545164, 1970952.72545164,
999 6378137, 6378337, 1971014.52885052, -5160183.02885052, -5160183.02885052,
1000 1971014.52885052, 6378337, 1977008.94649932, 610929.362499602, -1599433.83574926,
1001 -1599433.83574926, 610929.362499601, 1977008.94649932, -5166160.58090945, -1596431.41517097,
1002 4179511.70562570, 4179511.70562570, -1596431.41517097, -5166160.58090945, -5166160.58090945,
1003 -1596431.41517097, 4179511.70562570, 4179511.70562570, -1596431.41517097, -5166160.58090945,
1004 1977008.94649932, 610929.362499601, -1599433.83574926, -1599433.83574926, 610929.362499601,
1005 1977008.94649932, 6378337, 1971014.52885052, -5160183.02885052, -5160183.02885052,
1006 1971014.52885052, 6378337, 6378537, 1971076.33224939, -5160344.83224939,
1007 -5160344.83224940, 1971076.33224939, 6378537, 1977070.74989820, 610948.460800164,
1008 -1599483.83574926, -1599483.83574926, 610948.460800164, 1977070.74989820, -5166322.38430833,
1009 -1596481.41517097, 4179642.60732513, 4179642.60732514, -1596481.41517097, -5166322.38430833,
1010 -5166322.38430833, -1596481.41517097, 4179642.60732514, 4179642.60732514, -1596481.41517097,
1011 -5166322.38430833, 1977070.74989820, 610948.460800164, -1599483.83574926, -1599483.83574926,
1012 610948.460800163, 1977070.74989820, 6378537, 1971076.33224939, -5160344.83224939,
1013 -5160344.83224940, 1971076.33224939, 6378537, 6378737, 1971138.13564827,
1014 -5160506.63564827, -5160506.63564827, 1971138.13564827, 6378737, 1977132.55329707,
1015 610967.559100727, -1599533.83574926, -1599533.83574926, 610967.559100726, 1977132.55329707,
1016 -5166484.18770720, -1596531.41517097, 4179773.50902457, 4179773.50902457, -1596531.41517097,
1017 -5166484.18770720, -5166484.18770720, -1596531.41517097, 4179773.50902457, 4179773.50902457,
1018 -1596531.41517097, -5166484.18770720, 1977132.55329707, 610967.559100726, -1599533.83574926,
1019 -1599533.83574926, 610967.559100726, 1977132.55329707, 6378737, 1971138.13564827,
1020 -5160506.63564827, -5160506.63564827, 1971138.13564827, 6378737, 6378937,
1021 1971199.93904714, -5160668.43904714, -5160668.43904714, 1971199.93904714, 6378937,
1022 1977194.35669595, 610986.657401289, -1599583.83574926, -1599583.83574926, 610986.657401289,
1023 1977194.35669595, -5166645.99110608, -1596581.41517097, 4179904.41072401, 4179904.41072401,
1024 -1596581.41517097, -5166645.99110608, -5166645.99110608, -1596581.41517097, 4179904.41072401,
1025 4179904.41072401, -1596581.41517097, -5166645.99110608, 1977194.35669595, 610986.657401289,
1026 -1599583.83574926, -1599583.83574926, 610986.657401288, 1977194.35669595, 6378937,
1027 1971199.93904714, -5160668.43904714, -5160668.43904714, 1971199.93904714, 6378937,
1028 6379137, 1971261.74244602, -5160830.24244602, -5160830.24244602, 1971261.74244602,
1029 6379137, 1977256.16009482, 611005.755701852, -1599633.83574926, -1599633.83574926,
1030 611005.755701851, 1977256.16009482, -5166807.79450495, -1596631.41517097, 4180035.31242345,
1031 4180035.31242345, -1596631.41517097, -5166807.79450495, -5166807.79450495, -1596631.41517097,
1032 4180035.31242345, 4180035.31242345, -1596631.41517097, -5166807.79450495, 1977256.16009482,
1033 611005.755701851, -1599633.83574926, -1599633.83574926, 611005.755701851, 1977256.16009482,
1034 6379137, 1971261.74244602, -5160830.24244602, -5160830.24244602, 1971261.74244602,
1035 6379137,
1036};
1037
1038const double YWGS84_MATLAB[216] = {
1039 0,
1040 6065968.75567322,
1041 3748974.86570096,
1042 -3748974.86570096,
1043 -6065968.75567322,
1044 -1.56219301231466e-09,
1045 0,
1046 1880188.46281677,
1047 1162020.37527618,
1048 -1162020.37527618,
1049 -1880188.46281677,
1050 -4.84212398176294e-10,
1051 0,
1052 -4913156.80052423,
1053 -3036497.89478166,
1054 3036497.89478166,
1055 4913156.80052423,
1056 1.26530477345549e-09,
1057 0,
1058 -4913156.80052423,
1059 -3036497.89478166,
1060 3036497.89478166,
1061 4913156.80052423,
1062 1.26530477345549e-09,
1063 0,
1064 1880188.46281677,
1065 1162020.37527618,
1066 -1162020.37527618,
1067 -1880188.46281677,
1068 -4.84212398176293e-10,
1069 0,
1070 6065968.75567322,
1071 3748974.86570096,
1072 -3748974.86570096,
1073 -6065968.75567322,
1074 -1.56219301231466e-09,
1075 0,
1076 6066158.96697648,
1077 3749092.42275142,
1078 -3749092.42275142,
1079 -6066158.96697648,
1080 -1.56224199818663e-09,
1081 0,
1082 1880247.24134200,
1083 1162056.70240258,
1084 -1162056.70240258,
1085 -1880247.24134200,
1086 -4.84227535643215e-10,
1087 0,
1088 -4913310.68470109,
1089 -3036593.00043329,
1090 3036593.00043329,
1091 4913310.68470109,
1092 1.26534440385840e-09,
1093 0,
1094 -4913310.68470109,
1095 -3036593.00043329,
1096 3036593.00043329,
1097 4913310.68470109,
1098 1.26534440385840e-09,
1099 0,
1100 1880247.24134200,
1101 1162056.70240258,
1102 -1162056.70240258,
1103 -1880247.24134200,
1104 -4.84227535643215e-10,
1105 0,
1106 6066158.96697648,
1107 3749092.42275142,
1108 -3749092.42275142,
1109 -6066158.96697648,
1110 -1.56224199818663e-09,
1111 0,
1112 6066349.17827974,
1113 3749209.97980188,
1114 -3749209.97980187,
1115 -6066349.17827974,
1116 -1.56229098405859e-09,
1117 0,
1118 1880306.01986723,
1119 1162093.02952898,
1120 -1162093.02952898,
1121 -1880306.01986723,
1122 -4.84242673110137e-10,
1123 0,
1124 -4913464.56887795,
1125 -3036688.10608492,
1126 3036688.10608492,
1127 4913464.56887795,
1128 1.26538403426130e-09,
1129 0,
1130 -4913464.56887795,
1131 -3036688.10608492,
1132 3036688.10608492,
1133 4913464.56887795,
1134 1.26538403426130e-09,
1135 0,
1136 1880306.01986722,
1137 1162093.02952898,
1138 -1162093.02952898,
1139 -1880306.01986723,
1140 -4.84242673110137e-10,
1141 0,
1142 6066349.17827974,
1143 3749209.97980188,
1144 -3749209.97980187,
1145 -6066349.17827974,
1146 -1.56229098405859e-09,
1147 0,
1148 6066539.38958300,
1149 3749327.53685233,
1150 -3749327.53685233,
1151 -6066539.38958300,
1152 -1.56233996993056e-09,
1153 0,
1154 1880364.79839246,
1155 1162129.35665538,
1156 -1162129.35665538,
1157 -1880364.79839246,
1158 -4.84257810577059e-10,
1159 0,
1160 -4913618.45305481,
1161 -3036783.21173655,
1162 3036783.21173655,
1163 4913618.45305481,
1164 1.26542366466421e-09,
1165 0,
1166 -4913618.45305481,
1167 -3036783.21173655,
1168 3036783.21173655,
1169 4913618.45305481,
1170 1.26542366466421e-09,
1171 0,
1172 1880364.79839245,
1173 1162129.35665538,
1174 -1162129.35665538,
1175 -1880364.79839245,
1176 -4.84257810577058e-10,
1177 0,
1178 6066539.38958300,
1179 3749327.53685233,
1180 -3749327.53685233,
1181 -6066539.38958300,
1182 -1.56233996993056e-09,
1183 0,
1184 6066729.60088626,
1185 3749445.09390279,
1186 -3749445.09390279,
1187 -6066729.60088626,
1188 -1.56238895580252e-09,
1189 0,
1190 1880423.57691768,
1191 1162165.68378178,
1192 -1162165.68378178,
1193 -1880423.57691768,
1194 -4.84272948043980e-10,
1195 0,
1196 -4913772.33723167,
1197 -3036878.31738818,
1198 3036878.31738818,
1199 4913772.33723167,
1200 1.26546329506711e-09,
1201 0,
1202 -4913772.33723167,
1203 -3036878.31738818,
1204 3036878.31738818,
1205 4913772.33723167,
1206 1.26546329506711e-09,
1207 0,
1208 1880423.57691768,
1209 1162165.68378178,
1210 -1162165.68378178,
1211 -1880423.57691768,
1212 -4.84272948043980e-10,
1213 0,
1214 6066729.60088626,
1215 3749445.09390279,
1216 -3749445.09390279,
1217 -6066729.60088626,
1218 -1.56238895580252e-09,
1219 0,
1220 6066919.81218952,
1221 3749562.65095325,
1222 -3749562.65095325,
1223 -6066919.81218952,
1224 -1.56243794167449e-09,
1225 0,
1226 1880482.35544291,
1227 1162202.01090818,
1228 -1162202.01090818,
1229 -1880482.35544291,
1230 -4.84288085510902e-10,
1231 0,
1232 -4913926.22140853,
1233 -3036973.42303981,
1234 3036973.42303981,
1235 4913926.22140853,
1236 1.26550292547002e-09,
1237 0,
1238 -4913926.22140853,
1239 -3036973.42303981,
1240 3036973.42303981,
1241 4913926.22140853,
1242 1.26550292547002e-09,
1243 0,
1244 1880482.35544291,
1245 1162202.01090818,
1246 -1162202.01090818,
1247 -1880482.35544291,
1248 -4.84288085510902e-10,
1249 0,
1250 6066919.81218952,
1251 3749562.65095325,
1252 -3749562.65095325,
1253 -6066919.81218952,
1254 -1.56243794167449e-09,
1255};
1256
1257const double ZWGS84_MATLAB[216] = {
1258 0,
1259 0,
1260 0,
1261 0,
1262 0,
1263 0,
1264 6043686.27224277,
1265 6043686.27224277,
1266 6043686.27224277,
1267 6043686.27224277,
1268 6043686.27224277,
1269 6043686.27224277,
1270 3728191.67583129,
1271 3728191.67583129,
1272 3728191.67583129,
1273 3728191.67583129,
1274 3728191.67583129,
1275 3728191.67583129,
1276 -3728191.67583129,
1277 -3728191.67583129,
1278 -3728191.67583129,
1279 -3728191.67583129,
1280 -3728191.67583129,
1281 -3728191.67583129,
1282 -6043686.27224277,
1283 -6043686.27224277,
1284 -6043686.27224277,
1285 -6043686.27224277,
1286 -6043686.27224277,
1287 -6043686.27224277,
1288 -1.55173509867228e-09,
1289 -1.55173509867228e-09,
1290 -1.55173509867228e-09,
1291 -1.55173509867228e-09,
1292 -1.55173509867228e-09,
1293 -1.55173509867228e-09,
1294 0,
1295 0,
1296 0,
1297 0,
1298 0,
1299 0,
1300 6043876.48354603,
1301 6043876.48354603,
1302 6043876.48354603,
1303 6043876.48354603,
1304 6043876.48354603,
1305 6043876.48354603,
1306 3728309.23288175,
1307 3728309.23288175,
1308 3728309.23288175,
1309 3728309.23288175,
1310 3728309.23288175,
1311 3728309.23288175,
1312 -3728309.23288175,
1313 -3728309.23288175,
1314 -3728309.23288175,
1315 -3728309.23288175,
1316 -3728309.23288175,
1317 -3728309.23288175,
1318 -6043876.48354603,
1319 -6043876.48354603,
1320 -6043876.48354603,
1321 -6043876.48354603,
1322 -6043876.48354603,
1323 -6043876.48354603,
1324 -1.55178408454425e-09,
1325 -1.55178408454425e-09,
1326 -1.55178408454425e-09,
1327 -1.55178408454425e-09,
1328 -1.55178408454425e-09,
1329 -1.55178408454425e-09,
1330 0,
1331 0,
1332 0,
1333 0,
1334 0,
1335 0,
1336 6044066.69484929,
1337 6044066.69484929,
1338 6044066.69484929,
1339 6044066.69484929,
1340 6044066.69484929,
1341 6044066.69484929,
1342 3728426.78993221,
1343 3728426.78993221,
1344 3728426.78993221,
1345 3728426.78993221,
1346 3728426.78993221,
1347 3728426.78993221,
1348 -3728426.78993221,
1349 -3728426.78993221,
1350 -3728426.78993221,
1351 -3728426.78993221,
1352 -3728426.78993221,
1353 -3728426.78993221,
1354 -6044066.69484929,
1355 -6044066.69484929,
1356 -6044066.69484929,
1357 -6044066.69484929,
1358 -6044066.69484929,
1359 -6044066.69484929,
1360 -1.55183307041621e-09,
1361 -1.55183307041621e-09,
1362 -1.55183307041621e-09,
1363 -1.55183307041621e-09,
1364 -1.55183307041621e-09,
1365 -1.55183307041621e-09,
1366 0,
1367 0,
1368 0,
1369 0,
1370 0,
1371 0,
1372 6044256.90615255,
1373 6044256.90615255,
1374 6044256.90615255,
1375 6044256.90615255,
1376 6044256.90615255,
1377 6044256.90615255,
1378 3728544.34698267,
1379 3728544.34698267,
1380 3728544.34698267,
1381 3728544.34698267,
1382 3728544.34698267,
1383 3728544.34698267,
1384 -3728544.34698267,
1385 -3728544.34698267,
1386 -3728544.34698267,
1387 -3728544.34698267,
1388 -3728544.34698267,
1389 -3728544.34698267,
1390 -6044256.90615255,
1391 -6044256.90615255,
1392 -6044256.90615255,
1393 -6044256.90615255,
1394 -6044256.90615255,
1395 -6044256.90615255,
1396 -1.55188205628818e-09,
1397 -1.55188205628818e-09,
1398 -1.55188205628818e-09,
1399 -1.55188205628818e-09,
1400 -1.55188205628818e-09,
1401 -1.55188205628818e-09,
1402 0,
1403 0,
1404 0,
1405 0,
1406 0,
1407 0,
1408 6044447.11745581,
1409 6044447.11745581,
1410 6044447.11745581,
1411 6044447.11745581,
1412 6044447.11745581,
1413 6044447.11745581,
1414 3728661.90403313,
1415 3728661.90403313,
1416 3728661.90403313,
1417 3728661.90403313,
1418 3728661.90403313,
1419 3728661.90403313,
1420 -3728661.90403313,
1421 -3728661.90403313,
1422 -3728661.90403313,
1423 -3728661.90403313,
1424 -3728661.90403313,
1425 -3728661.90403313,
1426 -6044447.11745581,
1427 -6044447.11745581,
1428 -6044447.11745581,
1429 -6044447.11745581,
1430 -6044447.11745581,
1431 -6044447.11745581,
1432 -1.55193104216015e-09,
1433 -1.55193104216015e-09,
1434 -1.55193104216015e-09,
1435 -1.55193104216015e-09,
1436 -1.55193104216015e-09,
1437 -1.55193104216015e-09,
1438 0,
1439 0,
1440 0,
1441 0,
1442 0,
1443 0,
1444 6044637.32875907,
1445 6044637.32875907,
1446 6044637.32875907,
1447 6044637.32875907,
1448 6044637.32875907,
1449 6044637.32875907,
1450 3728779.46108359,
1451 3728779.46108359,
1452 3728779.46108359,
1453 3728779.46108359,
1454 3728779.46108359,
1455 3728779.46108359,
1456 -3728779.46108358,
1457 -3728779.46108358,
1458 -3728779.46108358,
1459 -3728779.46108358,
1460 -3728779.46108358,
1461 -3728779.46108358,
1462 -6044637.32875907,
1463 -6044637.32875907,
1464 -6044637.32875907,
1465 -6044637.32875907,
1466 -6044637.32875907,
1467 -6044637.32875907,
1468 -1.55198002803211e-09,
1469 -1.55198002803211e-09,
1470 -1.55198002803211e-09,
1471 -1.55198002803211e-09,
1472 -1.55198002803211e-09,
1473 -1.55198002803211e-09,
1474};
1475
1476/**
1477 * @ingroup mobility
1478 * @ingroup tests
1479 * @defgroup mobility-test mobility module tests
1480 */
1481
1482/**
1483 * @ingroup mobility-test
1484 *
1485 * @brief Geo To Cartesian Test Case
1486 *
1487 * This test verifies the accuracy of the GeographicToCartesianCoordinates()
1488 * method in the GeographicPositions class, which converts earth
1489 * geographic/geodetic coordinates to ECEF Cartesian coordinates. To do so, it
1490 * compares the values generated from the method to values generated from the
1491 * MATLAB function geodetic2ecef(), which is part of the MATLAB Mapping Toolbox,
1492 * using the built-in earth referenceSphere, GRS80 referenceEllipsoid, and WGS84
1493 * referenceEllipsoid in MATLAB. A description of the MATLAB function can be
1494 * found at this webpage: http://www.mathworks.com/help/map/ref/geodetic2ecef.html
1495 * Values are compared using 216 test cases for each of the three earth spheroid
1496 * models.
1497 */
1499{
1500 public:
1501 /**
1502 * Constructor
1503 *
1504 * @param latitude latitude (deg)
1505 * @param longitude longitude (deg)
1506 * @param altitude altitude (m)
1507 * @param sphType sphere type
1508 * @param i index
1509 */
1510 GeoToCartesianTestCase(double latitude,
1511 double longitude,
1512 double altitude,
1514 int i);
1515 ~GeoToCartesianTestCase() override;
1516
1517 private:
1518 void DoRun() override;
1519
1520 /**
1521 * Name function
1522 * @param latitude the latitude (deg)
1523 * @param longitude the longitude (deg)
1524 * @param altitude the altitude (m)
1525 * @param sphType the sphere type
1526 * @returns the name string
1527 */
1528 static std::string Name(double latitude,
1529 double longitude,
1530 double altitude,
1532 double m_latitude; ///< latitude (deg)
1533 double m_longitude; ///< longitude (deg)
1534 double m_altitude; ///< altitude (m)
1536 int m_i; ///< index
1537};
1538
1539std::string
1541 double longitude,
1542 double altitude,
1544{
1545 std::ostringstream oss;
1546 oss << "Geo->Cart: "
1547 << "LAT-LON-ALT-SPHEROID = " << latitude << " deg - " << longitude << " deg - " << altitude
1548 << " m - ";
1549 switch (sphType)
1550 {
1552 oss << "SPHERE";
1553 break;
1555 oss << "GRS80";
1556 break;
1558 oss << "WGS84";
1559 break;
1560 };
1561
1562 return oss.str();
1563}
1564
1566 double longitude,
1567 double altitude,
1569 int i)
1570 : TestCase(Name(latitude, longitude, altitude, sphType)),
1571 m_latitude(latitude),
1572 m_longitude(longitude),
1573 m_altitude(altitude),
1574 m_sphType(sphType),
1575 m_i(i)
1576{
1577}
1578
1582
1583void
1585{
1588 m_altitude,
1589 m_sphType);
1591 {
1594 TOLERANCE,
1595 "x coordinate (" << cart.x
1596 << ") is incorrect "
1597 "for perfect sphere model in iteration "
1598 << m_i);
1601 TOLERANCE,
1602 "y coordinate (" << cart.y
1603 << ") is incorrect "
1604 "for perfect sphere model in iteration "
1605 << m_i);
1608 TOLERANCE,
1609 "z coordinate (" << cart.z
1610 << ") is incorrect "
1611 "for perfect sphere model in iteration "
1612 << m_i);
1613 }
1615 {
1618 TOLERANCE,
1619 "x coordinate (" << cart.x
1620 << ") is incorrect "
1621 "for GRS80 model in iteration "
1622 << m_i);
1625 TOLERANCE,
1626 "y coordinate (" << cart.y
1627 << ") is incorrect "
1628 "for GRS80 model in iteration "
1629 << m_i);
1632 TOLERANCE,
1633 "z coordinate (" << cart.z
1634 << ") is incorrect "
1635 "for GRS80 model in iteration "
1636 << m_i);
1637 }
1638 else // if m_sphType == GeographicPositions::WGS84
1639 {
1642 TOLERANCE,
1643 "x coordinate (" << cart.x
1644 << ") is incorrect "
1645 "for WGS84 model in iteration "
1646 << m_i);
1649 TOLERANCE,
1650 "y coordinate (" << cart.y
1651 << ") is incorrect "
1652 "for WGS84 model in iteration "
1653 << m_i);
1656 TOLERANCE,
1657 "z coordinate (" << cart.z
1658 << ") is incorrect "
1659 "for WGS84 model in iteration "
1660 << m_i);
1661 }
1662}
1663
1664/**
1665 * @ingroup mobility-test
1666 *
1667 * @brief Cartesian to Geo Test Case
1668 *
1669 * This test verifies the accuracy of the CartesianToGeographicCoordinates()
1670 * method in the GeographicPositions class, which converts earth
1671 * ECEF Cartesian coordinates to geographic/geodetic coordinates. To do so, it
1672 * compares the values generated from the method and converted back to geographic
1673 * coordinates. Values are compared using 216 test cases for each of the three
1674 * earth spheroid models.
1675 */
1677{
1678 public:
1679 /**
1680 * Constructor
1681 *
1682 * @param latitude latitude (deg)
1683 * @param longitude longitude (deg)
1684 * @param altitude altitude (m)
1685 * @param sphType sphere type
1686 * @param i index
1687 */
1688 CartesianToGeoTestCase(double latitude,
1689 double longitude,
1690 double altitude,
1692 int i);
1693 ~CartesianToGeoTestCase() override;
1694
1695 private:
1696 void DoRun() override;
1697
1698 /**
1699 * Name function
1700 * @param latitude the latitude (deg)
1701 * @param longitude the longitude (deg)
1702 * @param altitude the altitude (m)
1703 * @param sphType the sphere type
1704 * @returns the name string
1705 */
1706 static std::string Name(double latitude,
1707 double longitude,
1708 double altitude,
1710 double m_latitude; ///< latitude (deg)
1711 double m_longitude; ///< longitude (deg)
1712 double m_altitude; ///< altitude (m)
1714};
1715
1716std::string
1718 double longitude,
1719 double altitude,
1721{
1722 std::ostringstream oss;
1723 oss << "Cart->Geo: "
1724 << "LAT-LON-ALT-SPHEROID = " << latitude << " deg - " << longitude << " deg - " << altitude
1725 << " m - ";
1726 switch (sphType)
1727 {
1729 oss << "SPHERE";
1730 break;
1732 oss << "GRS80";
1733 break;
1735 oss << "WGS84";
1736 break;
1737 };
1738
1739 return oss.str();
1740}
1741
1743 double longitude,
1744 double altitude,
1746 int i)
1747 : TestCase(Name(latitude, longitude, altitude, sphType)),
1748 m_latitude(latitude),
1749 m_longitude(longitude),
1750 m_altitude(altitude),
1751 m_sphType(sphType)
1752{
1753}
1754
1758
1759void
1761{
1764 m_altitude,
1765 m_sphType);
1767
1768 // geographic coords are ambiguous due to angular wrapping, convert to
1769 // rectangular for comparison
1770 Vector geocart =
1772
1774 2.5, // minimum passing tolerance (m)
1775 "Double conversion out-of-tolerance: "
1776 << geo << " <> "
1777 << Vector({m_latitude, m_longitude, m_altitude}));
1778}
1779
1780/**
1781 * @ingroup mobility-test
1782 *
1783 * @brief Geo To Cartesian Test Suite
1784 */
1786{
1787 public:
1789};
1790
1792 : TestSuite("geo-to-cartesian", Type::UNIT)
1793{
1794 NS_LOG_INFO("creating GeoToCartesianTestSuite");
1795 int i = 0; // iteration number
1796 for (double altitude = 0; altitude <= 1000; altitude += 200)
1797 {
1798 for (double latitude = 0; latitude <= 360; latitude += 72)
1799 {
1800 for (double longitude = 0; longitude <= 360; longitude += 72)
1801 {
1803 longitude,
1804 altitude,
1806 i),
1807 TestCase::Duration::QUICK);
1809 longitude,
1810 altitude,
1812 i),
1813 TestCase::Duration::QUICK);
1814 ++i;
1815 }
1816 }
1817 }
1818 i = 0;
1819 for (double altitude = 0; altitude <= 1000; altitude += 200)
1820 {
1821 for (double latitude = 0; latitude <= 360; latitude += 72)
1822 {
1823 for (double longitude = 0; longitude <= 360; longitude += 72)
1824 {
1826 longitude,
1827 altitude,
1829 i),
1830 TestCase::Duration::QUICK);
1832 longitude,
1833 altitude,
1835 i),
1836 TestCase::Duration::QUICK);
1837 ++i;
1838 }
1839 }
1840 }
1841 i = 0;
1842 for (double altitude = 0; altitude <= 1000; altitude += 200)
1843 {
1844 for (double latitude = 0; latitude <= 360; latitude += 72)
1845 {
1846 for (double longitude = 0; longitude <= 360; longitude += 72)
1847 {
1849 longitude,
1850 altitude,
1852 i),
1853 TestCase::Duration::QUICK);
1855 longitude,
1856 altitude,
1858 i),
1859 TestCase::Duration::QUICK);
1860 ++i;
1861 }
1862 }
1863 }
1864}
1865
1866/**
1867 * @ingroup mobility-test
1868 * Static variable for test initialization
1869 */
Cartesian to Geo Test Case.
CartesianToGeoTestCase(double latitude, double longitude, double altitude, GeographicPositions::EarthSpheroidType sphType, int i)
Constructor.
double m_longitude
longitude (deg)
void DoRun() override
Implementation to actually run this TestCase.
static std::string Name(double latitude, double longitude, double altitude, GeographicPositions::EarthSpheroidType sphType)
Name function.
GeographicPositions::EarthSpheroidType m_sphType
spheroid type
double m_latitude
latitude (deg)
Geo To Cartesian Test Case.
double m_longitude
longitude (deg)
void DoRun() override
Implementation to actually run this TestCase.
GeoToCartesianTestCase(double latitude, double longitude, double altitude, GeographicPositions::EarthSpheroidType sphType, int i)
Constructor.
double m_latitude
latitude (deg)
GeographicPositions::EarthSpheroidType m_sphType
spheroid type
static std::string Name(double latitude, double longitude, double altitude, GeographicPositions::EarthSpheroidType sphType)
Name function.
Geo To Cartesian Test Suite.
EarthSpheroidType
The possible Earth spheroid models. .
static Vector GeographicToCartesianCoordinates(double latitude, double longitude, double altitude, EarthSpheroidType sphType)
Converts earth geographic/geodetic coordinates (latitude and longitude in degrees) with a given altit...
static Vector CartesianToGeographicCoordinates(Vector pos, EarthSpheroidType sphType)
Inverse of GeographicToCartesianCoordinates using [1].
encapsulates test code
Definition test.h:1050
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
const double ZSPHERE_MATLAB[216]
const double YGRS80_MATLAB[216]
const double YWGS84_MATLAB[216]
const double ZWGS84_MATLAB[216]
const double YSPHERE_MATLAB[216]
const double XSPHERE_MATLAB[216]
const double XWGS84_MATLAB[216]
const double ZGRS80_MATLAB[216]
const double XGRS80_MATLAB[216]
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
static GeoToCartesianTestSuite g_GeoToCartesianTestSuite
Static variable for test initialization.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition test.h:327
#define NS_TEST_ASSERT_MSG_LT_OR_EQ(actual, limit, msg)
Test that an actual value is less than or equal to a limit and report and abort if not.
Definition test.h:740
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Definition vector.cc:98
static const double TOLERANCE
Tolerance used to check reciprocal of two numbers.
static std::string Name(std::string str, uint32_t totalStreamSize, uint32_t sourceWriteSize, uint32_t serverReadSize, uint32_t serverWriteSize, uint32_t sourceReadSize, bool useIpv6)
Definition tcp-test.cc:155