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