08-Jan-2022 09:47:48 sphere_grid_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test sphere_grid(). SPHERE_GRID_TEST01 SPHERE_ICOS_POINT_NUM determines the size (number of vertices, edges and faces) in a grid on a sphere, made by subdividing an initial projected icosahedron. N determines the number of subdivisions of each edge of the icosahedral faces. N V E F -------- -------- -------- -------- 1 12 30 20 2 42 120 80 3 92 270 180 4 162 480 320 5 252 750 500 6 362 1080 720 7 492 1470 980 8 642 1920 1280 9 812 2430 1620 10 1002 3000 2000 11 1212 3630 2420 12 1442 4320 2880 13 1692 5070 3380 14 1962 5880 3920 15 2252 6750 4500 16 2562 7680 5120 17 2892 8670 5780 18 3242 9720 6480 19 3612 10830 7220 20 4002 12000 8000 Repeat, but using N constrained by doubling: N V E F -------- -------- -------- -------- 1 12 30 20 2 42 120 80 4 162 480 320 8 642 1920 1280 16 2562 7680 5120 32 10242 30720 20480 64 40962 122880 81920 128 163842 491520 327680 256 655362 1966080 1310720 512 2621442 7864320 5242880 1024 10485762 31457280 20971520 SPHERE_GRID_TEST02 SPHERE_ICOS_POINT_NUM "sizes" a grid generated on an icosahedron and projected to a sphere. SPHERE_ICOS1_POINTS creates the grid points. Sizing factor = 7.000000 Number of points = 492 Initial part of NODE_XYZ array: Row: 1 2 3 Col 1: 0.850651 0.525731 0 2: 0.850651 -0.525731 0 3: 0.525731 0 0.850651 4: 0.525731 0 -0.850651 5: 0 0.850651 0.525731 6: 0 0.850651 -0.525731 7: 0 -0.850651 0.525731 8: 0 -0.850651 -0.525731 9: -0.525731 0 0.850651 10: -0.525731 0 -0.850651 11: -0.850651 0.525731 0 12: -0.850651 -0.525731 0 13: 0.914824 0.403852 0 14: 0.966666 0.256042 0 15: 0.996125 0.0879484 0 16: 0.996125 -0.0879484 0 17: 0.966666 -0.256042 0 18: 0.914824 -0.403852 0 19: 0.864906 0.484622 0.130689 20: 0.86117 0.426737 0.27619 Plot file saved to "sphere_icos1_points_f7.png". Wrote grid nodes to "sphere_icos1_points_f7.xyz". SPHERE_GRID_TEST03 SPHERE_ICOS_POINT_NUM "sizes" a grid generated on an icosahedron and projected to a sphere. SPHERE_ICOS2_POINTS creates the grid. Sizing factor FACTOR = 5 Number of points = 252 Initial part of NODE_XYZ array: Row: 1 2 3 Col 1: 0.850651 0.525731 0 2: 0.850651 -0.525731 0 3: 0.525731 0 0.850651 4: 0.525731 0 -0.850651 5: 0 0.850651 0.525731 6: 0 0.850651 -0.525731 7: 0 -0.850651 0.525731 8: 0 -0.850651 -0.525731 9: -0.525731 0 0.850651 10: -0.525731 0 -0.850651 11: -0.850651 0.525731 0 12: -0.850651 -0.525731 0 13: 0.945345 0.326071 0 14: 0.993877 0.110489 0 15: 0.993877 -0.110489 0 16: 0.945345 -0.326071 0 17: 0.865562 0.455163 0.208875 18: 0.838207 0.362369 0.407551 19: 0.769921 0.251881 0.586326 20: 0.664039 0.129092 0.73647 Plot file saved to "sphere_icos2_points_f5.png". Wrote grid nodes to "sphere_icos2_points_f5.xyz". SPHERE_GRID_TEST04 SPHERE_LL_POINTS produces latitude/longitude points on a sphere in 3D. Radius = 10.000000 Center: 1: 0 2: 0 3: 0 The number of latitudes = 3 The number of longitudes = 4 The number of grid points is 14 1 0.000000 0.000000 10.000000 2 7.071068 0.000000 7.071068 3 0.000000 7.071068 7.071068 4 -7.071068 0.000000 7.071068 5 -0.000000 -7.071068 7.071068 6 10.000000 0.000000 0.000000 7 0.000000 10.000000 0.000000 8 -10.000000 0.000000 0.000000 9 -0.000000 -10.000000 0.000000 10 7.071068 0.000000 -7.071068 11 0.000000 7.071068 -7.071068 12 -7.071068 0.000000 -7.071068 13 -0.000000 -7.071068 -7.071068 14 0.000000 0.000000 -10.000000 SPHERE_GRID_TEST05 SPHERE_SPIRALPOINTS produces a spiral of points on an implicit sphere in 3D. Radius = 1.000000 Center: 1: 0 2: 0 3: 0 The number of spiral points is 500 The spiral points: Row: 1 2 3 Col 1: 0 0 -1 2: -0.0203218 0.0871033 -0.995992 3: -0.126076 0.0085249 -0.991984 4: -0.0869129 -0.127866 -0.987976 5: 0.0536818 -0.170075 -0.983968 6: 0.178769 -0.0878637 -0.97996 7: 0.209391 0.0606077 -0.975952 8: 0.133698 0.19352 -0.971944 9: -0.00912706 0.251032 -0.967936 10: -0.159212 0.213294 -0.963928 Wrote grid nodes to "115". Wrote grid nodes to "112". Wrote grid nodes to "104". Wrote grid nodes to "101". Wrote grid nodes to "114". Wrote grid nodes to "101". Wrote grid nodes to "95". Wrote grid nodes to "103". Wrote grid nodes to "114". Wrote grid nodes to "105". Wrote grid nodes to "100". Wrote grid nodes to "95". Wrote grid nodes to "115". Wrote grid nodes to "112". Wrote grid nodes to "105". Wrote grid nodes to "114". Wrote grid nodes to "97". Wrote grid nodes to "108". Wrote grid nodes to "95". Wrote grid nodes to "110". Wrote grid nodes to "53". Wrote grid nodes to "48". Wrote grid nodes to "48". Wrote grid nodes to "46". Wrote grid nodes to "120". Wrote grid nodes to "121". Wrote grid nodes to "122". SPHERE_GRID_TEST06 SPHERE_LL_LINES computes gridlines on a sphere in 3D. Number of latitudes is 3 Number of longitudes is 4 Number of line segments is 36 Grid line vertices: Row: 1 2 Col 1: 1 2 2: 2 6 3: 6 10 4: 10 14 5: 1 3 6: 3 7 7: 7 11 8: 11 14 9: 1 4 10: 4 8 11: 8 12 12: 12 14 13: 1 5 14: 5 9 15: 9 13 16: 13 14 17: 2 3 18: 3 4 19: 4 5 20: 5 2 21: 6 7 22: 7 8 23: 8 9 24: 9 6 25: 10 11 26: 11 12 27: 12 13 28: 13 10 29: 2 7 30: 7 12 31: 3 8 32: 8 13 33: 4 9 34: 9 10 35: 5 6 36: 6 11 SPHERE_GRID_TEST07 SPHERE_GRID_Q4 computes a grid of Q4 rectangular elements on a sphere in 3D. Number of latitudes is 3 Number of longitudes is 4 The number of rectangles is 12 Rectangle vertices: Row: 1 2 3 4 Col 1: 2 3 1 1 2: 3 4 1 1 3: 4 5 1 1 4: 5 2 1 1 5: 6 7 3 2 6: 7 8 4 3 7: 8 9 5 4 8: 9 6 2 5 9: 7 6 10 10 10: 8 7 10 10 11: 9 8 10 10 12: 6 9 10 10 SPHERE_GRID_TEST08 SPHERE_GRID_T3 computes a grid of T3 triangular elements on a sphere in 3D. Number of latitudes is 3 Number of longitudes is 4 The number of triangles is 32 Triangle vertices: Row: 1 2 3 Col 1: 2 3 1 2: 3 4 1 3: 4 5 1 4: 5 2 1 5: 6 7 2 6: 3 2 7 7: 7 8 3 8: 4 3 8 9: 8 9 4 10: 5 4 9 11: 9 6 5 12: 2 5 6 13: 10 11 6 14: 7 6 11 15: 11 12 7 16: 8 7 12 17: 12 13 8 18: 9 8 13 19: 13 10 9 20: 6 9 10 21: 14 15 10 22: 11 10 15 23: 15 16 11 24: 12 11 16 25: 16 17 12 26: 13 12 17 27: 17 14 13 28: 10 13 14 29: 15 14 18 30: 16 15 18 31: 17 16 18 32: 14 17 18 SPHERE_GRID_TEST09 For the unit sphere in 3 dimensions: SPHERE_UNIT_SAMPLE does a random sampling. First 10 values: Row: 1 2 3 Col 1: 0.644843 -0.43356 0.629447 2: 0.569693 -0.34481 -0.746026 3: 0.788822 0.554693 0.264718 4: -0.857905 -0.260281 -0.443004 5: 0.393645 -0.0882797 0.915014 6: 0.716351 -0.133888 -0.684774 7: -0.403253 0.0371585 0.914334 8: 0.502333 0.622084 0.600561 9: 0.852453 -0.498837 -0.156477 10: 0.785314 -0.204306 0.584415 Wrote grid nodes to "sphere_sample_n1000.xyz". SPHERE_GRID_TEST10 SPHERE_CUBED_POINTS computes points on a cubed sphere grid. Number of divisions on each face = 10 Total number of points = 602 Initial part of XYZ array: Row: 1 2 3 Col 1: -0.57735 -0.57735 -0.57735 2: -0.62896 -0.456966 -0.62896 3: -0.665247 -0.33896 -0.665247 4: -0.689152 -0.223919 -0.689152 5: -0.702714 -0.111299 -0.702714 6: -0.707107 0 -0.707107 7: -0.702714 0.111299 -0.702714 8: -0.689152 0.223919 -0.689152 9: -0.665247 0.33896 -0.665247 10: -0.62896 0.456966 -0.62896 11: -0.57735 0.57735 -0.57735 12: -0.456966 -0.62896 -0.62896 13: -0.506732 -0.506732 -0.697457 14: -0.543426 -0.381106 -0.747962 15: -0.568473 -0.254229 -0.782436 16: -0.583019 -0.127097 -0.802456 17: -0.587785 0 -0.809017 18: -0.583019 0.127097 -0.802456 19: -0.568473 0.254229 -0.782436 20: -0.543426 0.381106 -0.747962 Plot file saved to "sphere_cubed_points_f10.png". Wrote grid nodes to "sphere_cubed_grid_f10.xyz". SPHERE_GRID_TEST11 SPHERE_LL_POINTS computes points on a latitude/longitude grid SPHERE_LL_LINES computes lines on a latitude/longitude grid Use this information to draw a globe with a grid. Number of latitudes is 22 Number of longitudes is 24 The number of grid points is 530 Number of line segments is 1584 Saving plot as "sphere_ll_points.png". Saving plot as "sphere_ll_grid.png". SPHERE_GRID_TEST12 SPHERE_LL_POINTS computes points on a latitude/longitude grid SPHERE_LLQ_LINES computes lines on a latitude/longitude quadrilateral grid Use this information to draw a globe with a grid. Number of latitudes is 10 Number of longitudes is 12 The number of grid points is 122 Number of line segments is 252 Saving plot as "sphere_llq_grid.png". SPHERE_GRID_TEST13 SPHERE_CUBED_LINES produces cubed sphere grid lines. Each cube face is divided into 5x5 subfaces The number of points is 152 The number of grid lines is 300 Saving plot as "sphere_cubed_grid.png". sphere_grid_test(): Normal end of execution. 08-Jan-2022 09:47:58