05 May 2022 09:39:29 AM tetrahedron_test(): C version Test tetrahedron(). tetrahedron_barycentric_test(): tetrahedron_barycentric() converts Cartesian to barycentric coordinates. We randomly sample the tetrahedron, getting Cartesian coordinates. We compute the barycentric coordinates to verify that the points are inside the tetrahedron. Tetrahedron vertices Row: 1 2 3 Col 1 1.000000 4.000000 3.000000 2 2.000000 4.000000 3.000000 3 1.000000 6.000000 3.000000 4 1.000000 4.000000 4.000000 P Barycentric: 1.013300 4.977047 3.100407 0.397769 0.013300 0.488523 0.100407 1.293366 4.070314 3.496566 0.174912 0.293366 0.035157 0.496566 1.425279 4.018494 3.201736 0.363738 0.425279 0.009247 0.201736 1.645625 4.191892 3.117486 0.140943 0.645625 0.095946 0.117486 1.096834 5.021761 3.129893 0.262393 0.096834 0.510881 0.129893 1.006448 4.081413 3.075348 0.877498 0.006448 0.040706 0.075348 1.402400 4.091339 3.007490 0.544440 0.402400 0.045670 0.007490 1.612693 4.004976 3.328675 0.056144 0.612693 0.002488 0.328675 1.028579 4.138652 3.540593 0.361502 0.028579 0.069326 0.540593 1.065549 4.342075 3.469235 0.294179 0.065549 0.171037 0.469235 tetrahedron_centroid_test(): tetrahedron_centroid() computes the centroid of a tetrahedron. Tetrahedron vertices: Row: 1 2 3 Col 1 0.000000 0.942809 -0.333333 2 -0.816496 -0.816496 -0.333333 3 0.816496 -0.816496 -0.333333 4 0.000000 0.000000 1.000000 Centroid: 0: 0 1: -0.172546 2: 2.5e-07 tetrahedron_contains_point_test(): tetrahedron_contains_point() finds if a point is inside a tetrahedron; Tetrahedron vertices: Row: 1 2 3 Col 1 0.000000 0.942809 -0.333333 2 -0.816496 -0.816496 -0.333333 3 0.816496 -0.816496 -0.333333 4 0.000000 0.000000 1.000000 P Inside_Tetra? 0.081650 -0.244949 0.600000 1 -1.469693 -3.021943 -0.200000 0 -0.898146 0.672598 -0.200000 0 tetrahedron_circumsphere_test(): tetrahedron_circumsphere() computes the circumsphere of a tetrahedron. Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.816497 Circumsphere center: 0: 1.11022e-16 1: 0 2: 0.204124 Circumsphere radius is 0.612372 tetrahedron_edge_length_test(): tetrahedron_edge_length() computes the edge lengths of a tetrahedron. Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.816497 Edge lengths: 0: 1 1: 1 2: 1 3: 1 4: 1 5: 1 tetrahedron_insphere_test(): tetrahedron_insphere() computes the insphere of a tetrahedron Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.816497 Insphere center: 0: -3.20494e-17 1: 0 2: 0.204124 Insphere radius is 0.204124 tetrahedron_lattice_layer_point_next_test(): tetrahedron_lattice_layer_point_next() returns the next point in a tetrahedron lattice layer defined by: C[3] - 1 < X[0]/C[0] + X[1]/C[1] +X[2]/C[2] <= C[3]. N = 3 C = 2 3 4 Layer 0 1 0 0 0 No more. Layer 1 1 1 0 0 2 2 0 0 3 0 1 0 4 1 1 0 5 0 2 0 6 0 3 0 7 0 0 1 8 1 0 1 9 0 1 1 10 0 2 1 11 0 0 2 12 1 0 2 13 0 1 2 14 0 0 3 15 0 0 4 No more. Layer 2 1 3 0 0 2 4 0 0 3 2 1 0 4 3 1 0 5 1 2 0 6 2 2 0 7 1 3 0 8 2 3 0 9 0 4 0 10 1 4 0 11 0 5 0 12 0 6 0 13 2 0 1 14 3 0 1 15 1 1 1 16 2 1 1 17 1 2 1 18 2 2 1 19 0 3 1 20 1 3 1 21 0 4 1 22 0 5 1 23 2 0 2 24 3 0 2 25 1 1 2 26 2 1 2 27 0 2 2 28 1 2 2 29 0 3 2 30 1 3 2 31 0 4 2 32 1 0 3 33 2 0 3 34 0 1 3 35 1 1 3 36 0 2 3 37 1 2 3 38 0 3 3 39 1 0 4 40 2 0 4 41 0 1 4 42 1 1 4 43 0 2 4 44 0 3 4 45 0 0 5 46 1 0 5 47 0 1 5 48 0 2 5 49 0 0 6 50 1 0 6 51 0 1 6 52 0 0 7 53 0 0 8 No more. tetrahedron_lattice_point_next_test(): tetrahedron_lattice_point_next() returns the next lattice point in a tetrahedron defined by: 0 <= X(1)/C(1) + X(2)/C(2) + X(3)/C(3) <= C(4). N = 3 C = 4 3 2 1 1 0 0 0 2 1 0 0 3 2 0 0 4 0 1 0 5 1 1 0 No more. tetrahedron_quality1_test(): tetrahedron_quality1() computes quality measure #1 for a tetrahedron. Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.816497 Tetrahedron quality is 1 Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.408248 Tetrahedron quality is 0.732051 tetrahedron_quality2_test(): tetrahedron_quality2() computes quality measure #2 for a tetrahedron. Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.816497 Tetrahedron quality is 1 Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.408248 Tetrahedron quality is 0.732051 tetrahedron_quality3_test() tetrahedron_quality3() computes quality measure #3 for a tetrahedron. Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.816497 Tetrahedron quality is 1 Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.408248 Tetrahedron quality is 0.839947 tetrahedron_quality4_test(): tetrahedron_quality4() computes quality measure #4 for a tetrahedron. Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.816497 Tetrahedron quality is 1 Tetrahedron vertices: Row: 1 2 3 Col 1 0.577350 0.000000 0.000000 2 -0.288675 0.500000 0.000000 3 -0.288675 -0.500000 0.000000 4 0.000000 0.000000 0.408248 Tetrahedron quality is 0.62132 tetrahedron_rhombic_shape_test(): For the rhombic tetrahedron, tetrahedron_rhombic_size() returns dimension information; tetrahedron_rhombic_shape() returns face and order information. shape_print() prints this information. Number of vertices: 10 Number of edges : 6 Number of faces : 4 Maximum face order: 6 SHAPE_PRINT_3D Information about a polytope. The number of vertices is 10 Vertices: Index X Y Z 1 -0.81649658 0.00000000 0.00000000 2 0.00000000 -0.57735027 0.00000000 3 0.00000000 0.57735027 0.00000000 4 0.00000000 0.00000000 0.81649658 5 -0.40824829 -0.28867513 0.00000000 6 -0.40824829 0.28867513 0.00000000 7 -0.40824829 0.00000000 0.40824829 8 0.00000000 0.00000000 0.00000000 9 0.00000000 -0.28867513 0.40824829 10 0.00000000 0.28867513 0.40824829 The number of faces is 4 The maximum order of any face is 6 Index Order Indices of Nodes in Face 1 2 3 4 5 6 1 6 1 5 2 9 4 7 2 6 2 8 3 10 4 9 3 6 3 6 1 7 4 10 4 6 1 6 3 8 2 5 tetrahedron_sample_test(): tetrahedron_sample() samples a tetrahedron. We compute the barycentric coordinates to verify that the points are inside the tetrahedron. Tetrahedron vertices Row: 1 2 3 Col 1 1.000000 4.000000 3.000000 2 2.000000 4.000000 3.000000 3 1.000000 6.000000 3.000000 4 1.000000 4.000000 4.000000 P Barycentric: 1.013300 4.977047 3.100407 0.397769 0.013300 0.488523 0.100407 1.293366 4.070314 3.496566 0.174912 0.293366 0.035157 0.496566 1.425279 4.018494 3.201736 0.363738 0.425279 0.009247 0.201736 1.645625 4.191892 3.117486 0.140943 0.645625 0.095946 0.117486 1.096834 5.021761 3.129893 0.262393 0.096834 0.510881 0.129893 1.006448 4.081413 3.075348 0.877498 0.006448 0.040706 0.075348 1.402400 4.091339 3.007490 0.544440 0.402400 0.045670 0.007490 1.612693 4.004976 3.328675 0.056144 0.612693 0.002488 0.328675 1.028579 4.138652 3.540593 0.361502 0.028579 0.069326 0.540593 1.065549 4.342075 3.469235 0.294179 0.065549 0.171037 0.469235 tetrahedron_shape_test(): For the tetrahedron, tetrahedron_size() returns dimension information; tetrahedron_shape() returns face and order information. shape_print() prints this information. Number of vertices: 4 Number of edges : 12 Number of faces : 4 Maximum face order: 3 SHAPE_PRINT_3D Information about a polytope. The number of vertices is 4 Vertices: Index X Y Z 1 0.94280900 0.00000000 -0.33333300 2 -0.47140500 0.81649700 -0.33333300 3 -0.47140500 -0.81649700 -0.33333300 4 0.00000000 0.00000000 1.00000000 The number of faces is 4 The maximum order of any face is 3 Index Order Indices of Nodes in Face 1 2 3 1 3 1 3 2 2 3 1 2 4 3 3 1 4 3 4 3 2 3 4 tetrahedron_solid_angles_test(): tetrahedron_solid_angles() computes the solid angles associated with the vertices of a tetrahedron. Tetrahedron #1 Row: 1 2 3 Col 1 0.000000 0.942809 -0.333333 2 -0.816496 -0.816496 -0.333333 3 0.816496 -0.816496 -0.333333 4 0.000000 0.000000 1.000000 Solid angles for tetrahedron #1 0: 0.455087 1: 0.535656 2: 0.535656 3: 0.641025 Tetrahedron #2 Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 1.000000 0.000000 0.000000 3 0.000000 1.000000 0.000000 4 0.000000 0.000000 1.000000 Solid angles for tetrahedron #2 0: 1.5708 1: 0.339837 2: 0.339837 3: 0.339837 Tetrahedron #3 Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 1.000000 0.000000 0.000000 3 0.000000 2.000000 0.000000 4 0.000000 0.000000 4.000000 Solid angles for tetrahedron #3 0: 1.5708 1: 0.899175 2: 0.289752 3: 0.0581062 Tetrahedron #4 Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 1.000000 0.000000 0.000000 3 0.000000 1.000000 0.000000 4 1.000000 1.000000 1.000000 Solid angles for tetrahedron #4 0: 0.523599 1: 0.445561 2: 0.445561 3: 0.183762 tetrahedron_test(): Normal end of execution. 05 May 2022 09:39:29 AM