>> distance_to_position_sphere ( 'ha30_dist.txt', 39.59 ) 25-Feb-2009 08:44:38 DISTANCE_TO_POSITION_SPHERE MATLAB version Read a distance table for N points or cities on a sphere of a given radius. Assign coordinates to each point which will reproduce the distance table with the lowest discrepancy, in the least squares sense. Read the header of "ha30_dist.txt". Spatial dimension M = 3 Number of points N = 30 Read the data in "ha30_dist.txt". 5 by 5 portion of distance table: Col: 1 2 3 4 5 Row 1 0 39 22 59 54 2 39 0 20 20 81 3 22 20 0 39 74 4 59 20 39 0 93 5 54 81 74 93 0 Norm of First-order Iteration Func-count f(x) step optimality CG-iterations 0 61 949580 4.1e+04 1 122 515198 3.63374 1.74e+04 2 2 183 383596 2.21326 1.38e+04 2 3 244 283315 6.36157 1.63e+04 3 4 305 225067 10 2.22e+04 4 5 366 136112 3.2335 1.03e+04 4 6 427 99214 20 8.87e+03 7 7 488 95412.8 5.09816 1.31e+04 3 8 549 79339.9 1.27454 1.06e+04 4 9 610 68839.9 2.91032 1.05e+04 3 10 671 60684.9 1.43425 6.53e+03 3 11 732 52162.6 1.35269 7.01e+03 2 12 793 49341.3 0.495505 1.46e+03 3 13 854 49011.7 0.105795 1.61e+03 2 14 915 48671.5 0.091052 1.7e+03 2 15 976 48295.7 0.0958718 1.71e+03 2 16 1037 47919.7 0.0973973 1.62e+03 2 17 1098 47586.6 0.0937819 1.43e+03 2 18 1159 47325.5 0.0853843 1.18e+03 2 19 1220 47135.4 0.0753703 935 2 20 1281 46991 0.0687911 748 2 21 1342 46856.1 0.0702782 718 2 22 1403 46685 0.0829959 941 2 23 1464 46391 0.111692 1.34e+03 2 24 1525 45707.5 0.171622 2.15e+03 2 25 1586 43560.4 0.310103 3.77e+03 2 26 1647 36592.3 0.710879 5.36e+03 3 27 1708 22386.4 1.46681 1.32e+04 3 28 1769 5643.92 1.11259 8.98e+03 2 29 1830 44.6213 0.516841 258 2 30 1891 34.124 0.0235148 13.2 2 31 1952 34.085 0.00202238 1.35 2 32 2013 34.0847 0.000145447 0.0262 3 Optimization terminated: relative function value changing by less than OPTIONS.TolFun. Least squares residual for solution is 5.838209e+00 Computed LL coordinates: Row: 1 2 Col 1 -0.336811 0.157629 2 0.551720 -0.294059 3 0.211574 0.119543 4 2.157284 -3.818104 5 -1.232762 -1.752955 6 0.349113 -0.327097 7 3.326106 1.797146 8 -0.477944 1.026143 9 0.952619 2.429394 10 0.066473 1.989348 11 0.351735 -0.121102 12 0.047799 1.279558 13 0.064162 0.154003 14 1.796363 5.827065 15 0.412053 22.245030 16 -0.748153 1.435269 17 -0.447223 0.817746 18 0.463735 0.156360 19 -0.663620 1.149787 20 -0.530540 0.824029 21 -1.062743 1.078241 22 0.071208 0.102821 23 -1.104024 -1.007700 24 0.145203 -0.059606 25 -0.279910 1.487597 26 -1.319934 3.980531 27 -0.166195 1.349894 28 1.267720 1.491256 29 0.408177 -3.009342 30 1.007579 -10.851240 Computed XYZ coordinates: Row: 1 2 3 Col 1 36.902328 5.865524 13.083650 2 32.268564 -9.772170 -20.751207 3 38.430958 4.616171 -8.313876 4 17.085076 -13.717743 -32.974108 5 -2.378420 -12.912119 37.349544 6 35.229322 -11.952753 -13.542328 7 8.734037 -37.925268 7.263521 8 18.213856 30.067160 18.209597 9 -17.367236 14.994152 -32.263332 10 -16.055342 36.092639 -2.629740 11 36.893950 -4.489910 -13.639841 12 11.354847 37.879510 -1.891633 13 39.040952 6.060413 -2.538418 14 -7.949413 3.900184 -38.587090 15 -35.113496 -9.111273 -15.855447 16 3.920608 28.751273 26.932531 17 24.411612 26.044301 17.121206 18 34.976862 5.514005 -17.708273 19 12.745841 28.464310 24.386363 20 23.195509 25.060627 20.032510 21 9.107489 16.970196 34.589510 22 39.281107 4.053225 -2.816748 23 9.510174 -15.065098 35.354879 24 39.103806 -2.333589 -5.728422 25 3.162014 37.917558 10.937482 26 -6.567441 -7.311222 38.350787 27 8.555034 38.095727 6.549431 28 0.938855 11.778574 -37.785604 29 -36.020211 -4.791656 -15.714724 30 -3.040275 20.917682 -33.474997 5 by 5 portion of computed distance table: Col: 1 2 3 4 5 Row 1 0 39.1347 21.7613 59.1894 53.9145 2 39.1347 0 20.2109 20.1026 81.2434 3 21.7613 20.2109 0 38.9696 74.0209 4 59.1894 20.1026 38.9696 0 92.8123 5 53.9145 81.2434 74.0209 92.8123 0 Wrote the recomputed distance data to "ha30_dist.dist2.txt". Wrote the XYZ data to "ha30_dist.xyz.txt". Wrote the Latitude/Longitude data to "ha30_dist.latlon.txt". DISTANCE_TO_POSITION_SPHERE Normal end of execution. 25-Feb-2009 08:44:59 >>