>> geometry_test 04-Dec-2010 11:04:52 GEOMETRY_TEST MATLAB version Test the GEOMETRY library. TEST0005 ANGLE_BOX_2D Compute P4 and P5, normal to line through P1 and P2, and line through P2 and P3, and DIST units from P2. P1: 0.000000 0.000000 P2: 3.000000 0.000000 P3: 4.000000 2.000000 DIST = 1.000000 P4: 2.381966 1.000000 P5: 3.618034 -1.000000 P1: 0.000000 0.000000 P2: 3.000000 0.000000 P3: 2.000000 -2.000000 DIST = 1.000000 P4: 3.618034 -1.000000 P5: 2.381966 1.000000 P1: 3.000000 0.000000 P2: 3.000000 0.000000 P3: 2.000000 -2.000000 DIST = 1.000000 P4: 2.105573 0.447214 P5: 3.894427 -0.447214 TEST001 ANGLE_CONTAINS_POINT_2D sees if a point lies within an angle. Vertex P1 1 1.000000 2 0.000000 Vertex P2 1 0.000000 2 0.000000 Vertex P3 1 1.000000 2 1.000000 X Y Inside? 1.000000 0.000000 1 0.866025 0.500000 0 0.500000 0.866025 1 0.000000 1.000000 1 -0.500000 0.866025 1 -0.866025 0.500000 1 -1.000000 0.000000 1 -0.866025 -0.500000 1 -0.500000 -0.866025 1 -0.000000 -1.000000 1 0.500000 -0.866025 1 0.866025 -0.500000 1 1.000000 -0.000000 1 Vertex P1 1 1.000000 2 0.000000 Vertex P2 1 0.000000 2 0.000000 Vertex P3 1 0.000000 2 1.000000 X Y Inside? 1.000000 0.000000 1 0.866025 0.500000 0 0.500000 0.866025 0 0.000000 1.000000 1 -0.500000 0.866025 1 -0.866025 0.500000 1 -1.000000 0.000000 1 -0.866025 -0.500000 1 -0.500000 -0.866025 1 -0.000000 -1.000000 1 0.500000 -0.866025 1 0.866025 -0.500000 1 1.000000 -0.000000 1 Vertex P1 1 1.000000 2 -1.000000 Vertex P2 1 0.000000 2 0.000000 Vertex P3 1 0.000000 2 1.000000 X Y Inside? 1.000000 0.000000 0 0.866025 0.500000 0 0.500000 0.866025 0 0.000000 1.000000 1 -0.500000 0.866025 1 -0.866025 0.500000 1 -1.000000 0.000000 1 -0.866025 -0.500000 1 -0.500000 -0.866025 1 -0.000000 -1.000000 1 0.500000 -0.866025 1 0.866025 -0.500000 0 1.000000 -0.000000 0 Vertex P1 1 1.000000 2 0.000000 Vertex P2 1 0.000000 2 0.000000 Vertex P3 1 -1.000000 2 0.000000 X Y Inside? 1.000000 0.000000 1 0.866025 0.500000 0 0.500000 0.866025 0 0.000000 1.000000 0 -0.500000 0.866025 0 -0.866025 0.500000 0 -1.000000 0.000000 1 -0.866025 -0.500000 1 -0.500000 -0.866025 1 -0.000000 -1.000000 1 0.500000 -0.866025 1 0.866025 -0.500000 1 1.000000 -0.000000 1 Vertex P1 1 1.000000 2 0.000000 Vertex P2 1 0.000000 2 0.000000 Vertex P3 1 0.000000 2 -1.000000 X Y Inside? 1.000000 0.000000 1 0.866025 0.500000 0 0.500000 0.866025 0 0.000000 1.000000 0 -0.500000 0.866025 0 -0.866025 0.500000 0 -1.000000 0.000000 0 -0.866025 -0.500000 0 -0.500000 -0.866025 0 -0.000000 -1.000000 0 0.500000 -0.866025 1 0.866025 -0.500000 1 1.000000 -0.000000 1 Vertex P1 1 1.000000 2 0.000000 Vertex P2 1 0.000000 2 0.000000 Vertex P3 1 1.000000 2 -0.010000 X Y Inside? 1.000000 0.000000 1 0.866025 0.500000 0 0.500000 0.866025 0 0.000000 1.000000 0 -0.500000 0.866025 0 -0.866025 0.500000 0 -1.000000 0.000000 0 -0.866025 -0.500000 0 -0.500000 -0.866025 0 -0.000000 -1.000000 0 0.500000 -0.866025 0 0.866025 -0.500000 0 1.000000 -0.000000 1 TEST002 ANGLE_DEG_2D computes an angle; ANGLE_RAD_ND computes an angle. X, Y, Theta, atan2(y, x), ANGLE_RAD_ND, ANGLE_DEG_2D 1.000000 0.000000 0.000000 0.000000 0.000000 1.570796 1.570796 1.570796 0.000000 0.866025 0.500000 30.000000 30.000000 0.523599 1.570796 1.047198 1.570796 330.000000 0.500000 0.866025 60.000000 60.000000 1.047198 1.570796 0.523599 1.570796 300.000000 0.000000 1.000000 90.000000 90.000000 1.570796 1.570796 0.000000 1.570796 270.000000 -0.500000 0.866025 120.000000 120.000000 2.094395 1.570796 0.523599 1.570796 240.000000 -0.866025 0.500000 150.000000 150.000000 2.617994 1.570796 1.047198 1.570796 210.000000 -1.000000 0.000000 180.000000 180.000000 3.141593 1.570796 1.570796 1.570796 180.000000 -0.866025 -0.500000 210.000000 -150.000000 2.617994 1.570796 2.094395 1.570796 150.000000 -0.500000 -0.866025 240.000000 -120.000000 2.094395 1.570796 2.617994 1.570796 120.000000 -0.000000 -1.000000 270.000000 -90.000000 1.570796 1.570796 3.141593 1.570796 90.000000 0.500000 -0.866025 300.000000 -60.000000 1.047198 1.570796 2.617994 1.570796 60.000000 0.866025 -0.500000 330.000000 -30.000000 0.523599 1.570796 2.094395 1.570796 30.000000 1.000000 -0.000000 360.000000 -0.000000 0.000000 1.570796 1.570796 1.570796 0.000000 TEST0023 ANGLE_HALF_2D computes the half angle between two rays; The angle is defined by the points (P1,P2,P3) or by the rays P2-->P3, P2-->P1. Point P1: 1 5.776457 2 5.897777 Point P2: 1 5.000000 2 3.000000 Point P3: 1 6.931852 2 3.517638 End point of unit ray from P2, defining half angle, P4: 1 5.707107 2 3.707107 Expected value of P4: 1 5.707107 2 3.707107 TEST0025 ANGLE_RAD_2D computes the angle between two rays; Angle = 5.497787 Angle = 4.712389 Angle = 3.926991 Angle = 3.141593 Angle = 1.570796 Angle = 0.010000 TEST003 ANGLE_RAD_3D computes an angle; P, ANGLE_RAD_3D, (Degrees) 1.000000 0.000000 0.000000 1.570796 90.000000 1.000000 2.000000 3.000000 0.640522 36.699225 0.000000 0.000000 1.000000 0.000000 0.000000 TEST0032 ANGLE_TURN_2D computes the turning angle defined by the line segments [P1,P2] and [P2,P3]. Our three points are: P1 = (C,S) P2 = (0,0) P3 = (1,0) C = cosine ( theta), S = sine ( theta ). Test Theta Angle 1 0.000000 3.141593 2 30.000000 2.617994 3 60.000000 2.094395 4 90.000000 1.570796 5 120.000000 1.047198 6 150.000000 0.523599 7 180.000000 0.000000 8 210.000000 -0.523599 9 240.000000 -1.047198 10 270.000000 -1.570796 11 300.000000 -2.094395 12 330.000000 -2.617994 13 360.000000 -3.141593 TEST0035 ANNULUS_SECTOR_CENTROID_2D computes the centroid of a circular annulus. The circle has center 5.000000 3.000000 The inner radius is R1 = 2.000000 The outer radius is R2 = 3.000000 The first angle is THETA1 = 0.523599 The second angle is THETA2 = 1.047198 Centroid: 6.770944 4.770944 TEST004 ARC_COSINE computes an angle with a given cosine; X, ARC_COSINE(X), (Degrees) 5.000000 0.000000 0.000000 1.200000 0.000000 0.000000 1.000000 0.000000 0.000000 0.900000 0.451027 25.841933 0.500000 1.047198 60.000000 0.000000 1.570796 90.000000 -0.900000 2.690566 154.158067 -1.000000 3.141593 180.000000 -1.010000 3.141593 180.000000 TEST005 ATAN4 computes an angle with a given tangent. X, Y, ATAN(Y/X), ATAN2(Y,X), ATAN4(Y,X) 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.785398 0.785398 0.785398 1.000000 2.000000 1.107149 1.107149 1.107149 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 -1.000000 -0.785398 -0.785398 5.497787 -1.000000 -1.000000 0.785398 -2.356194 3.926991 -1.000000 -1.000000 0.785398 -2.356194 3.926991 0.000000 -1.000000 Inf -1.570796 4.712389 Repeat, but display answers in degrees. 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 45.000000 45.000000 45.000000 1.000000 2.000000 63.434949 63.434949 63.434949 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 -1.000000 -45.000000 -45.000000 315.000000 -1.000000 -1.000000 45.000000 -135.000000 225.000000 -1.000000 -1.000000 45.000000 -135.000000 225.000000 0.000000 -1.000000 Inf -90.000000 270.000000 TEST006 For the unit ball in 2 dimensions (the disk): BALL_UNIT_SAMPLE_2D samples; A few sample values: 0.449860 -0.126667 -0.843197 -0.344280 0.589627 0.260090 0.391140 0.323400 -0.139466 -0.156136 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N_SAMPLE increases. Average: -0.000091 0.019733 Now average the distance of the points from the center, which should be 1/sqrt(2) = 0.707107 Average: 0.669616 Now average the angle THETA, which should be PI. Average: 3.215980 TEST007 For the unit ball in 3 dimensions: BALL_UNIT_SAMPLE_3D samples; A few sample values: 0.747368 -0.210437 -0.529145 -0.345789 0.203599 0.049895 0.237652 0.196494 -0.170945 0.683223 0.279121 0.205248 0.026689 -0.908632 -0.183031 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N_SAMPLE increases. Average: 0.008976 0.005202 0.016862 Now average the distance of the points from the center, which should be the 1/2**(1/dim_num) = 0.793701 Average: 0.756237 Now average the angle THETA, which should be PI. Average: 3.128960 Now average the angle PHI, which should be PI/2. Average: 1.585480 TEST0075 For the unit ball in N dimensions: BALL_UNIT_SAMPLE_ND samples; A few sample values: -0.358320 0.064876 -0.521755 -0.710225 0.499314 0.274178 0.565223 0.228155 0.729504 0.481155 0.247561 -0.453197 0.626242 -0.091314 -0.734782 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N increases. Average: -0.017521 0.012085 -0.021175 Now average the distance of the points from the center, which should be the 1/2**(1/dim_num) = 0.793701 Average: 0.742079 Now average the angle THETA, which should be PI. Average: 3.116587 Now average the angle PHI, which should be PI/2. Average: 1.570236 TEST008 BASIS_MAP_3D computes the linear transform A which maps vectors U1, U2 and U3 to vectors V1, V2 and V3. The matrix U Col: 1 2 3 Row 1 1 0 1 2 2 0 0 3 3 1 2 The matrix V Col: 1 2 3 Row 1 14 3 7 2 4 1 3 3 4 0 2 The transformation matrix Col: 1 2 3 Row 1 1 2 3 2 1 0 1 3 2 1 0 The product matrix A * [ U1 | U2 | U3 ] Col: 1 2 3 Row 1 14 3 7 2 4 1 3 3 4 0 2 TEST009 BOX_SEGMENT_CLIP_2D clips a line with respect to a box. The lower left box corner is: -10.000000 10.000000 The upper right box corner is: 10.000000 20.000000 We list the points PA and PB, and then the clipped values. 1.000000 2.000000 8.000000 16.000000 5.000000 10.000000 -3.000000 12.000000 5.000000 12.000000 Line is inside the box. -20.000000 20.000000 7.000000 20.000000 -10.000000 20.000000 -20.000000 40.000000 0.000000 0.000000 -10.000000 20.000000 -5.000000 10.000000 10.000000 40.000000 20.000000 30.000000 Line is outside the box. TEST010 For a box with coordinate line sides in 2D, BOX_RAY_INT_2D computes the intersection of the box and a ray whose origin is within the box. Lower left box corner: 0.000000 0.000000 Upper right box corner: 5.000000 3.000000 Origin: 3.000000 1.000000 Point 2: 5.000000 5.000000 Intersection: 4.000000 3.000000 Correct: 4.000000 3.000000 Origin: 4.000000 1.000000 Point 2: 3.000000 1.000000 Intersection: -0.000000 1.000000 Correct: 0.000000 1.000000 Origin: 3.000000 1.000000 Point 2: 4.000000 2.000000 Intersection: 5.000000 3.000000 Correct: 5.000000 3.000000 TEST011 CIRCLE_DIA2IMP_2D converts a diameter to an implicit circle in 2D. P1: 1 -0.080734 2 7.546487 P2: 1 4.080734 2 -1.546487 The implicit circle: Radius = 5.000000 Center = 2.000000 3.000000 TEST012 CIRCLE_LUNE_AREA_2D computes the area of a circular lune, defined by joining the endpoints of a circular arc. CIRCLE_SECTOR_AREA_2D computes the area of a circular sector, defined by joining the endpoints of a circular arc to the center. CIRCLE_TRIANGLE_AREA_2D computes the signed area of a triangle, defined by joining the endpoints of a circular arc and the center. R Theta1 Theta2 Sector Triangle Lune 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.523599 0.261799 0.250000 0.011799 1.000000 0.000000 1.047198 0.523599 0.433013 0.090586 1.000000 0.000000 1.570796 0.785398 0.500000 0.285398 1.000000 0.000000 2.094395 1.047198 0.433013 0.614185 1.000000 0.000000 2.617994 1.308997 0.250000 1.058997 1.000000 0.000000 3.141593 1.570796 0.000000 1.570796 1.000000 0.000000 3.665191 1.832596 -0.250000 2.082596 1.000000 0.000000 4.188790 2.094395 -0.433013 2.527408 1.000000 0.000000 4.712389 2.356194 -0.500000 2.856194 1.000000 0.000000 5.235988 2.617994 -0.433013 3.051007 1.000000 0.000000 5.759587 2.879793 -0.250000 3.129793 1.000000 0.000000 6.283185 3.141593 -0.000000 3.141593 TEST0125 CIRCLE_LUNE_AREA_2D computes the area of a circular lune, defined by joining the endpoints of a circular arc (THETA1,THETA2). SPHERE_CAP_VOLUME_2D computes the volume (area) of a spherical cap, defined by a plane that cuts the sphere to a thickness of H units. SPHERE_CAP_VOLUME_ND does the same operation, but in N dimensions. The two routines should get the same results if THETA1, THETA2 and H correspond. Using a radius R = 1.000000 Theta1 Theta2 H Lune Cap Cap area vol_3d vol_nd -0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.585686 0.585686 0.166667 0.125043 0.125043 0.125043 -0.841069 0.841069 0.333333 0.344165 0.344165 0.344165 -1.047198 1.047198 0.500000 0.614185 0.614185 0.614185 -1.230959 1.230959 0.666667 0.916690 0.916690 0.916690 -1.403348 1.403348 0.833333 1.239013 1.239013 1.239013 -1.570796 1.570796 1.000000 1.570796 1.570796 1.570796 -1.738244 1.738244 1.166667 1.902580 1.902580 1.902580 -1.910633 1.910633 1.333333 2.224903 2.224903 2.224903 -2.094395 2.094395 1.500000 2.527408 2.527408 2.527408 -2.300524 2.300524 1.666667 2.797428 2.797428 2.797428 -2.555907 2.555907 1.833333 3.016549 3.016549 3.016549 -3.141593 3.141593 2.000000 3.141593 3.141593 3.141593 TEST0126 SPHERE_CAP_VOLUME_3D computes the volume of a spherical cap, defined by a plane that cuts the sphere to a thickness of H units. SPHERE_CAP_VOLUME_ND does the same operation, but in N dimensions. Using a radius R = 1.000000 H Cap Cap volume_3d volume_nd 0.000000 0.000000 0.000000 0.166667 0.082418 0.082418 0.333333 0.310281 0.310281 0.500000 0.654498 0.654498 0.666667 1.085983 1.085983 0.833333 1.575644 1.575644 1.000000 2.094395 2.094395 1.166667 2.613146 2.613146 1.333333 3.102808 3.102808 1.500000 3.534292 3.534292 1.666667 3.878509 3.878509 1.833333 4.106372 4.106372 2.000000 4.188790 4.188790 TEST0127 SPHERE_CAP_AREA_3D computes the volume of a 3D spherical cap, defined by a plane that cuts the sphere to a thickness of H units. SPHERE_CAP_AREA_ND computes the volume of an ND spherical cap, defined by a plane that cuts the sphere to a thickness of H units. R H Cap Cap area_3d area_nd 1.000000 0.000000 0.000000 0.000000 1.000000 0.166667 1.047198 1.047198 1.000000 0.333333 2.094395 2.094395 1.000000 0.500000 3.141593 3.141593 1.000000 0.666667 4.188790 4.188790 1.000000 0.833333 5.235988 5.235988 1.000000 1.000000 6.283185 6.283185 1.000000 1.166667 7.330383 7.330383 1.000000 1.333333 8.377580 8.377580 1.000000 1.500000 9.424778 9.424778 1.000000 1.666667 10.471976 10.471976 1.000000 1.833333 11.519173 11.519173 1.000000 2.000000 12.566371 12.566371 TEST013 CIRCLE_LUNE_CENTROID_2D computes the centroid of a circular lune, defined by joining the endpoints of a circular arc. CIRCLE_SECTOR_CENTROID_2D computes the centroid of a circular sector, defined by joining the endpoints of a circular arc to the center. The implicit circle: Radius = 2.000000 Center = 5.000000 3.000000 The first angle of our lune and sector is always 0. Lune Sector THETA2 X Y X Y 0.000000 7.000000 3.000000 6.333333 3.000000 0.523599 6.696675 3.979576 6.141555 3.659077 1.047198 5.919935 4.593375 5.636620 4.102658 1.570796 5.000000 4.651743 5.000000 4.200422 2.094395 4.294980 4.221131 4.448671 3.954930 2.617994 4.017334 3.567343 4.147931 3.491942 3.141593 4.151174 3.000000 4.151174 3.000000 3.665191 4.500316 2.711507 4.391380 2.648613 4.188790 4.828673 2.703253 4.724336 2.522535 4.712389 5.000000 2.834954 5.000000 2.599859 5.235988 5.027313 2.952692 5.127324 2.779468 5.759587 5.006397 2.996307 5.103778 2.940084 6.283185 5.000000 3.000000 5.000000 3.000000 TEST014 CIRCLE_EXP_CONTAINS_POINT_2D determines if a point lies inside a circle. P1: 1 4.000000 2 2.000000 P2: 1 1.000000 2 5.000000 P3: 1 -2.000000 2 2.000000 P: 1 2.000000 2 3.000000 INSIDE = -1 The point is inside the circle. P1: 1 4.000000 2 2.000000 P2: 1 1.000000 2 5.000000 P3: 1 -2.000000 2 2.000000 P: 1 1.000000 2 -1.000000 INSIDE = 0 The point is on the circle. P1: 1 4.000000 2 2.000000 P2: 1 1.000000 2 5.000000 P3: 1 -2.000000 2 2.000000 P: 1 4.000000 2 6.000000 INSIDE = 1 The point is outside the circle TEST015 CIRCLE_EXP2IMP_2D computes the radius and center of the circle through three points. TRIANGLE_CIRCUMCIRCLE_2D computes the radius and center of the circle through the vertices of a triangle. P1: 1 4.000000 2 2.000000 P2: 1 4.000000 2 2.000000 P3: 1 4.000000 2 2.000000 The implicit circle: Radius = 0.000000 Center = 4.000000 2.000000 The triangle's circumcircle: Radius = -1.000000 Center = 0.000000 0.000000 P1: 1 1.000000 2 5.000000 P2: 1 5.000000 2 4.000000 P3: 1 1.000000 2 5.000000 The implicit circle: Radius = 2.061553 Center = 3.000000 4.500000 The triangle's circumcircle: Radius = -1.000000 Center = 0.000000 0.000000 P1: 1 -2.000000 2 2.000000 P2: 1 6.000000 2 6.000000 P3: 1 4.000000 2 2.000000 The implicit circle: Radius = 5.000000 Center = 1.000000 6.000000 The triangle's circumcircle: Radius = 5.000000 Center = 1.000000 6.000000 TEST0155 CIRCLE_EXP2IMP_2D computes the radius and center of the circle through three points. We can use this routine to compute, for three points in space, the circle incident to those points, and hence the radius of that circle, and hence the "curvature" of those points. Our three points are: (0,0) (1,0) (C,S) C = cosine ( theta), S = sine ( theta ). Test Theta Curvature 1 0.000000 2.000000 2 30.000000 1.931852 3 60.000000 1.732051 4 90.000000 1.414214 5 120.000000 1.000000 6 150.000000 0.517638 7 180.000000 0.000000 8 210.000000 0.517638 9 240.000000 1.000000 10 270.000000 1.414214 11 300.000000 1.732051 12 330.000000 1.931852 13 360.000000 2.000000 TEST0156 CIRCLE_EXP2IMP_2D converts an explicit circle to an implicit circle. CIRCLE_IMP2EXP_2D converts an implicit circle to an explicit circle. The implicit circle: Radius = 3.000000 Center = 10.000000 5.000000 P1: 1 13.000000 2 5.000000 P2: 1 8.500000 2 7.598076 P3: 1 8.500000 2 2.401924 The recovered implicit circle: Radius = 3.000000 Center = 10.000000 5.000000 TEST016 CIRCLE_IMP_POINTS_2D gets points on a circle; POLYGON_AREA_2D finds the area of a polygon. The implicit circle: Radius = 2.000000 Center = 5.000000 -2.000000 The area = 12.566371 Sample results: Col: 1 2 3 4 5 Row 1 7 6.41421 5 3.58579 3 2 -2 -0.585786 0 -0.585786 -2 Col: 6 7 8 Row 1 3.58579 5 6.41421 2 -3.41421 -4 -3.41421 For any N, the sampled points define a polygon whose area approximates the circle area. N Area 3 5.196152 4 8.000000 5 9.510565 6 10.392305 7 10.945641 8 11.313708 9 11.570177 10 11.755705 11 11.894098 12 12.000000 13 12.082802 14 12.148745 15 12.202099 16 12.245870 17 12.282217 18 12.312725 19 12.338580 20 12.360680 21 12.379717 22 12.396233 23 12.410651 24 12.423314 TEST0165 CIRCLE_IMP_POINTS_3D gets points on a circle in 3D; The implicit circle: Radius = 2.000000 Center = 5.000000 -2.000000 1.000000 Normal = 1.000000 1.000000 1.000000 Points on the circle: Row: 1 2 3 Col 1 4.183503 -2.816497 2.632993 2 3.585786 -2.000000 2.414214 3 3.367007 -1.183503 1.816497 4 3.585786 -0.585786 1.000000 5 4.183503 -0.367007 0.183503 6 5.000000 -0.585786 -0.414214 7 5.816497 -1.183503 -0.632993 8 6.414214 -2.000000 -0.414214 9 6.632993 -2.816497 0.183503 10 6.414214 -3.414214 1.000000 11 5.816497 -3.632993 1.816497 12 5.000000 -3.414214 2.414214 TEST017 CIRCLE_IMP_POINTS_ARC_2D returns points on a circular arc. The implicit circle: Radius = 2.000000 Center = 5.000000 -2.000000 The arc extends from THETA1 = 1.570796 to THETA2 = 4.712389 Sample results: Row: 1 2 Col 1 5.000000 0.000000 2 4.482362 -0.068148 3 4.000000 -0.267949 4 3.585786 -0.585786 5 3.267949 -1.000000 6 3.068148 -1.482362 7 3.000000 -2.000000 8 3.068148 -2.517638 9 3.267949 -3.000000 10 3.585786 -3.414214 11 4.000000 -3.732051 12 4.482362 -3.931852 13 5.000000 -4.000000 TEST018 CIRCLES_IMP_INT_2D determines the intersections of two circles in 2D. CIRCLE_IMP_POINT_DIST_2D checks, by finding the distance from a point to a circle. The first circle: Radius = 5.000000 Center = 0.000000 0.000000 The second circle: Radius = 0.500000 Center = 5.000000 5.000000 The circles do not intersect. The second circle: Radius = 5.000000 Center = 7.071068 7.071068 The circles intersect at two points: X Y Dist 1 Dist 2 3.535329 3.535739 0.000000 0.000000 3.535739 3.535329 0.000000 0.000000 The second circle: Radius = 3.000000 Center = 4.000000 0.000000 The circles intersect at two points: X Y Dist 1 Dist 2 4.000000 3.000000 0.000000 0.000000 4.000000 -3.000000 0.000000 0.000000 The second circle: Radius = 3.000000 Center = 6.000000 0.000000 The circles intersect at two points: X Y Dist 1 Dist 2 4.333333 2.494438 0.000000 0.000000 4.333333 -2.494438 0.000000 0.000000 The second circle: Radius = 5.000000 Center = 0.000000 0.000000 The circles coincide (infinite intersection). TEST0183 CIRCLE_LLR2IMP_2D is given: a line through P1 and P2, a line through Q1 and Q2, and a radius R, and determines the centers C of 4 circles of the given radius, tangent to both lines. Radius R = 1.175316 Point #P1: -5.631634 9.126352 Point #P2: 6.590185 1.233909 Point #Q1: -1.693858 -8.677625 Point #Q2: -4.848444 -7.800864 Center #1: 39.307969 -21.293222 Center #2: 32.675277 -17.010051 Center #1: 46.915076 -23.407483 Center #2: 40.282384 -19.124311 1.175316 1.175316 1.175316 1.175316 1.175316 1.175316 1.175316 1.175316 Radius R = 2.403009 Point #P1: 2.679314 -8.765455 Point #P2: -1.009221 -1.973874 Point #Q1: 5.093470 5.945739 Point #Q2: -9.963233 7.950081 Center #1: -1.754341 4.433109 Center #2: -4.592746 9.659372 Center #1: -7.649634 5.217888 Center #2: -10.488038 10.444151 2.403009 2.403009 2.403009 2.403009 2.403009 2.403009 2.403009 2.403009 Radius R = 1.454656 Point #P1: -8.109105 -9.727662 Point #P2: 7.181937 6.816949 Point #Q1: -7.537922 -9.849753 Point #Q2: -4.793940 8.249674 Center #1: -9.552352 -13.432406 Center #2: -6.032401 -9.623888 Center #1: -8.775002 -8.304971 Center #2: -5.255051 -4.496452 1.454656 1.454656 1.454656 1.454656 1.454656 1.454656 1.454656 1.454656 Radius R = 3.391668 Point #P1: -2.967427 6.457746 Point #P2: -4.657355 3.841330 Point #Q1: 1.233249 7.224316 Point #Q2: -0.924124 8.239541 Center #1: -6.561754 7.144073 Center #2: -2.848264 12.893452 Center #1: -0.368831 4.229786 Center #2: 3.344658 9.979165 3.391668 3.391668 3.391668 3.391668 3.391668 3.391668 3.391668 3.391668 Radius R = 1.851720 Point #P1: -6.220906 5.229841 Point #P2: -2.060230 -6.293718 Point #Q1: 1.487317 -2.659467 Point #Q2: 2.344097 -2.769426 Center #1: -6.379737 0.217101 Center #2: -4.966107 -3.698140 Center #1: -2.250974 -0.312786 Center #2: -0.837344 -4.228027 1.851720 1.851720 1.851720 1.851720 1.851720 1.851720 1.851720 1.851720 TEST0185 CIRCLE_PPPR2IMP_3D is given 3D points P1, P2, P3, and a radius R, and determines the centers C of two circles of the given radius, passing through P1 and P2 and lying in the plane of P1, P2 and P3. Radius R = 23.102682 Point #1: -5.631634 9.126352 6.590185 Point #2: 1.233909 -1.693858 -8.677625 Point #3: -4.848444 -7.800864 -9.123420 Center #1: -18.454343 -9.197675 0.798629 Center #2: 14.056617 16.630168 -2.886070 23.102682 23.102682 23.102682 23.102682 0.000000 0.000000 -0.000000 -0.000000 Radius R = 17.511453 Point #1: -8.765455 -1.009221 -1.973874 Point #2: 5.093470 5.945739 -9.963233 Point #3: 7.950081 -2.984953 -8.109105 Center #1: 5.592796 -10.698651 -4.544198 Center #2: -9.264781 15.635170 -7.392909 17.511453 17.511453 17.511453 17.511453 -0.000000 -0.000000 0.000000 0.000000 Radius R = 27.299856 Point #1: 7.181937 6.816949 -7.537922 Point #2: -9.849753 -4.793940 8.249674 Point #3: -7.726719 -2.967427 6.457746 Center #1: -3.717272 21.417517 12.792174 Center #2: 1.049456 -19.394508 -12.080421 27.299856 27.299856 27.299856 27.299856 -0.000000 -0.000000 0.000000 0.000000 Radius R = 10.902953 Point #1: 3.841330 1.233249 7.224316 Point #2: -0.924124 8.239541 1.958338 Point #3: -6.220906 5.229841 -2.060230 Center #1: -4.328564 -2.052790 0.795540 Center #2: 7.245769 11.525580 8.387113 10.902953 10.902953 10.902953 10.902953 0.000000 0.000000 -0.000000 -0.000000 Radius R = 9.727092 Point #1: 1.487317 -2.659467 2.344097 Point #2: -2.769426 -5.741400 4.289424 Point #3: -7.645863 -4.013417 6.500059 Center #1: -5.314776 3.579080 5.414664 Center #2: 4.032667 -11.979946 1.218857 9.727092 9.727092 9.727092 9.727092 -0.000000 -0.000000 0.000000 0.000000 TEST019 CIRCLE_PPR2IMP_2D is given points P1 and P2, and a radius R, and determines the centers C of two circles of the given radius, passing through P1 and P2. Radius R = 16.625195 Point #1: -5.631634 9.126352 Point #2: 6.590185 1.233909 Center #1: -7.630503 -7.378243 Center #2: 8.589054 17.738503 16.625195 16.625195 16.625195 16.625195 Radius R = 7.533787 Point #1: -8.677625 -4.848444 Point #2: -7.800864 -9.123420 Center #1: -15.303101 -8.434669 Center #2: -1.175388 -5.537195 7.533787 7.533787 7.533787 7.533787 Radius R = 13.117065 Point #1: -8.765455 -1.009221 Point #2: -1.973874 5.093470 Center #1: 2.849325 -7.104650 Center #2: -13.588655 11.188899 13.117065 13.117065 13.117065 13.117065 Radius R = 17.577906 Point #1: -9.963233 7.950081 Point #2: -2.984953 -8.109105 Center #1: -20.453814 -6.154191 Center #2: 7.505628 5.995167 17.577906 17.577906 17.577906 17.577906 Radius R = 23.537818 Point #1: 7.181937 6.816949 Point #2: -7.537922 -9.849753 Center #1: -15.728017 12.217219 Center #2: 15.372032 -15.250023 23.537818 23.537818 23.537818 23.537818 TEST020 For the cube, CUBE_SIZE_3D returns dimension information; CUBE_SHAPE_3D returns face and order information. SHAPE_PRINT_3D prints this information. Number of points = 8 Number of edges = 12 Number of faces = 6 Maximum face order = 4 SHAPE_PRINT_3D Information about a polytope. The number of vertices is 8 Vertices: Index X Y Z 1 -0.577350 -0.577350 -0.577350 2 0.577350 -0.577350 -0.577350 3 0.577350 0.577350 -0.577350 4 -0.577350 0.577350 -0.577350 5 -0.577350 -0.577350 0.577350 6 0.577350 -0.577350 0.577350 7 0.577350 0.577350 0.577350 8 -0.577350 0.577350 0.577350 The number of faces is 6 The maximum order of any face is 4 Index Order Indices of Nodes in Face 1 2 3 4 1 4 1 4 3 2 2 4 1 2 6 5 3 4 2 3 7 6 4 4 3 4 8 7 5 4 1 5 8 4 6 4 5 6 7 8 TEST0201 CYLINDER_POINT_DIST_3D computes the distance to a cylinder. Radius R = 1.000000 Center of bottom disk = 0.000000 -2.000000 0.000000 Center of top disk = 0.000000 2.000000 0.000000 P = 4.000000 0.500000 0.000000 DIST (computed) = 3.000000 DIST (exact) = 3.000000 P = -0.500000 -1.000000 0.000000 DIST (computed) = 0.500000 DIST (exact) = 0.500000 P = 4.000000 6.000000 0.000000 DIST (computed) = 5.000000 DIST (exact) = 5.000000 P = 0.750000 -10.000000 0.000000 DIST (computed) = 8.000000 DIST (exact) = 8.000000 P = 0.000000 0.000000 0.000000 DIST (computed) = 1.000000 DIST (exact) = 1.000000 P = 0.250000 1.750000 0.000000 DIST (computed) = 0.250000 DIST (exact) = 0.250000 TEST02015 CYLINDER_POINT_DIST_SIGNED_3D computes the signed distance to a cylinder. Radius R = 1.000000 Center of bottom disk = 0.000000 -2.000000 0.000000 Center of top disk = 0.000000 2.000000 0.000000 P = 4.000000 0.500000 0.000000 Signed distance (computed) = 3.000000 Signed distance (exact) = 3.000000 P = -0.500000 -1.000000 0.000000 Signed distance (computed) = -0.500000 Signed distance (exact) = -0.500000 P = 4.000000 6.000000 0.000000 Signed distance (computed) = 5.000000 Signed distance (exact) = 5.000000 P = 0.750000 -10.000000 0.000000 Signed distance (computed) = 8.000000 Signed distance (exact) = 8.000000 P = 0.000000 0.000000 0.000000 Signed distance (computed) = -1.000000 Signed distance (exact) = -1.000000 P = 0.250000 1.750000 0.000000 Signed distance (computed) = -0.250000 Signed distance (exact) = -0.250000 TEST0202 CYLINDER_POINT_INSIDE_3D determines if a point is inside a cylinder. Radius R = 1.000000 Center of bottom disk = 0.000000 -2.000000 0.000000 Center of top disk = 0.000000 2.000000 0.000000 P = 4.000000 0.500000 0.000000 INSIDE (computed) = 0 INSIDE (exact) = 0 P = -0.500000 -1.000000 0.000000 INSIDE (computed) = 1 INSIDE (exact) = 1 P = 4.000000 6.000000 0.000000 INSIDE (computed) = 0 INSIDE (exact) = 0 P = 0.750000 -10.000000 0.000000 INSIDE (computed) = 0 INSIDE (exact) = 0 P = 0.000000 0.000000 0.000000 INSIDE (computed) = 1 INSIDE (exact) = 1 P = 0.250000 1.750000 0.000000 INSIDE (computed) = 1 INSIDE (exact) = 1 TEST0203 CYLINDER_POINT_NEAR_3D computes the nearest point on a cylinder. Radius R = 1.000000 Center of bottom disk = 0.000000 -2.000000 0.000000 Center of top disk = 0.000000 2.000000 0.000000 P = 4.000000 0.500000 0.000000 PN (computed) = 1.000000 0.500000 0.000000 PN (exact) = 1.000000 0.500000 0.000000 P = -0.500000 -1.000000 0.000000 PN (computed) = -1.000000 -1.000000 0.000000 PN (exact) = -1.000000 -1.000000 0.000000 P = 4.000000 6.000000 0.000000 PN (computed) = 1.000000 2.000000 0.000000 PN (exact) = 1.000000 2.000000 0.000000 P = 0.750000 -10.000000 0.000000 PN (computed) = 0.750000 -2.000000 0.000000 PN (exact) = 0.750000 -2.000000 0.000000 P = 0.000000 0.000000 0.000000 PN (computed) = 1.000000 0.000000 0.000000 PN (exact) = 1.000000 0.000000 0.000000 P = 0.250000 1.750000 0.000000 PN (computed) = 0.250000 2.000000 0.000000 PN (exact) = 0.250000 2.000000 0.000000 (Note that case 5 is ambiguous. The set of nearest points forms a circle, any of which will do.) TEST02035 CYLINDER_SAMPLE_3D samples points in a cylinder. Radius R = 1.000000 Center of bottom disk = 0.000000 -2.000000 0.000000 Center of top disk = 0.000000 2.000000 0.000000 Sample points: Row: 1 2 3 Col 1 -0.361786 0.297463 -0.295853 2 -0.822879 -0.531893 -0.528382 3 0.636297 0.468819 -0.651641 4 0.035363 -0.553885 -0.748629 5 0.643093 -1.148280 0.041689 6 -0.134375 0.857885 -0.219230 7 0.332422 -1.529173 -0.383501 8 0.266259 -0.802683 0.197643 9 -0.187781 1.300012 -0.092560 10 0.791611 1.298640 0.085544 11 -0.232171 -1.752553 0.088453 12 -0.253317 0.843122 0.620781 13 -0.485012 -1.646867 -0.407517 14 0.248681 1.111976 0.832365 15 -0.469043 0.981212 -0.759793 16 -0.024746 -0.765300 0.035014 17 0.878530 1.597492 -0.354527 18 -0.590700 1.054147 -0.042727 19 0.185407 1.046923 0.245293 20 0.107185 -0.372121 -0.046132 TEST0204 CYLINDER_VOLUME_3D computes the volume of a cylinder. Radius R = 5.000000 Center of bottom disk = 1.000000 2.000000 3.000000 Center of top disk = 5.000000 6.000000 5.000000 Volume (computed) = 471.238898 Volume (exact) = 471.238898 TEST0205 DEGREES_TO_RADIANS converts an angle from degrees to radians; RADIANS_TO_DEGREES converts an angle from radians to degrees; Degrees Radians Degrees -60.000000 -1.047198 -60.000000 -30.000000 -0.523599 -30.000000 0.000000 0.000000 0.000000 30.000000 0.523599 30.000000 60.000000 1.047198 60.000000 90.000000 1.570796 90.000000 120.000000 2.094395 120.000000 150.000000 2.617994 150.000000 180.000000 3.141593 180.000000 210.000000 3.665191 210.000000 240.000000 4.188790 240.000000 270.000000 4.712389 270.000000 300.000000 5.235988 300.000000 330.000000 5.759587 330.000000 360.000000 6.283185 360.000000 390.000000 6.806784 390.000000 420.000000 7.330383 420.000000 TEST021 DIRECTION_PERT_3D perturbs a direction vector. The base vector: 1 1.000000 2 0.000000 3 0.000000 Using Sigma = 0.990000 0.969803 -0.066101 -0.234759 0.996265 -0.032640 0.079941 0.982502 0.075169 -0.170408 0.973054 0.146926 -0.177701 0.938419 -0.257673 0.230163 0.945068 0.101910 0.310582 0.981823 -0.189720 -0.005573 0.995474 0.001098 -0.095025 0.997838 0.052982 0.038877 0.953378 0.025788 -0.300674 0.996965 -0.065511 -0.042065 0.958541 0.013445 -0.284637 0.973262 -0.120036 -0.195837 0.956979 0.232984 0.172943 0.996105 0.087664 0.009473 0.992652 -0.045717 0.112035 0.997014 0.022105 0.073989 0.998158 -0.035014 0.049543 0.966951 -0.254297 -0.018394 0.981608 0.175355 -0.075472 Using Sigma = 0.500000 0.515739 0.635388 0.574714 0.571248 0.627366 0.529234 -0.077113 -0.972283 0.220725 -0.313831 0.904237 0.289596 0.816593 -0.514859 -0.260950 -0.502559 -0.838426 0.210894 -0.405750 -0.899882 -0.159934 0.726619 0.640878 0.247589 0.896706 -0.441027 -0.037602 0.745544 0.367754 0.555807 0.937782 -0.132047 0.321137 -0.733017 -0.004715 0.680194 -0.590565 0.592245 0.548160 0.042542 -0.775496 -0.629917 -0.659198 0.082246 -0.747458 -0.219273 0.642079 -0.734611 0.189802 0.668985 -0.718634 -0.090818 0.968967 -0.229900 0.565819 -0.767542 -0.301212 0.532435 0.826651 -0.182099 Using Sigma = 0.100000 0.577189 -0.805143 0.136370 -0.029050 -0.789143 -0.613522 0.900754 -0.234895 -0.365332 0.109754 0.187443 -0.976125 0.035178 0.964270 0.262576 0.823866 -0.492928 0.279761 -0.099049 0.829799 -0.549202 0.697238 -0.158992 -0.698986 0.526706 0.231514 0.817913 0.363916 0.514665 0.776328 0.149672 -0.859520 -0.488695 -0.646578 -0.746634 0.156440 0.591218 0.614060 0.522869 0.131610 0.678698 0.722529 -0.385925 -0.642343 -0.662162 0.564669 -0.426020 -0.706863 -0.668394 0.719030 0.190383 -0.707300 -0.700304 -0.096442 -0.281483 -0.668151 -0.688724 0.412494 -0.285986 -0.864905 TEST022 DIRECTION_UNIFORM_3D picks a random direction vector. 0.795416 -0.223966 -0.563163 -0.696321 -0.284310 0.659018 0.901719 0.397757 -0.169386 0.674043 0.557308 -0.484844 -0.272750 -0.305351 -0.912342 -0.457329 0.150061 -0.876546 0.028783 -0.979903 -0.197387 0.803987 0.009287 0.594574 -0.358866 0.489058 0.795008 0.583030 0.050005 -0.810910 TEST023 DIRECTION_UNIFORM_ND picks a random direction vector. 0.018901 0.915404 -0.257751 -0.308613 -0.124937 0.655667 0.289221 0.686180 0.298229 -0.473421 -0.530008 -0.637200 0.438129 0.023624 -0.804280 0.400771 0.003513 -0.124299 0.169394 0.977672 0.087315 0.140092 -0.218174 0.961847 0.046868 0.678834 -0.416085 -0.603209 0.856203 -0.034301 0.317415 -0.406186 -0.446622 -0.721634 0.215598 -0.483002 -0.129106 0.068628 -0.948792 0.280028 TEST0232 DISK_POINT_DIST_3D finds the distance from a disk to a point in 3D. Disk radius = 2.000000 Disk center: 1 0.000000 2 1.414214 3 1.414214 Disk axis: 1 0.000000 2 1.000000 3 1.000000 Point: 1 0.000000 2 0.000000 3 0.000000 Distance = 2.000000, Expected = 2.000000 Point: 1 0.000000 2 0.707107 3 2.121320 Distance = 0.000000, Expected = 0.000000 Point: 1 2.000000 2 1.414214 3 1.414214 Distance = 0.000000, Expected = 0.000000 Point: 1 10.000000 2 1.414214 3 1.414214 Distance = 8.000000, Expected = 8.000000 Point: 1 10.000000 2 5.656854 3 5.656854 Distance = 10.000000, Expected = 10.000000 TEST0234 R8MAT_SOLVE_2D solves 2D linear systems. Solution / Computed: 0.415307 0.415307 0.066119 0.066119 Solution / Computed: 0.061727 0.061727 0.449539 0.449539 Solution / Computed: 0.897504 0.897504 0.350752 0.350752 Solution / Computed: 0.123104 0.123104 0.007512 0.007512 Solution / Computed: 0.822887 0.822887 0.267132 0.267132 TEST0235 DMS_TO_RADIANS converts an angle from degrees/minutes/seconds to radians; RADIANS_TO_DEGREES converts an angle from radians to degrees/minutes/seconds; Radians DMS Radians -0.897598 -51 -25 -43 -0.897599 -0.448799 -25 -42 -51 -0.448797 0.000000 0 0 0 0.000000 0.448799 25 42 51 0.448797 0.897598 51 25 43 0.897599 1.346397 77 8 34 1.346395 1.795196 102 51 26 1.795197 2.243995 128 34 17 2.243994 2.692794 154 17 9 2.692796 3.141593 180 0 0 3.141593 3.590392 205 42 51 3.590390 4.039191 231 25 43 4.039191 4.487990 257 8 34 4.487988 4.936788 282 51 26 4.936790 5.385587 308 34 17 5.385587 5.834386 334 17 9 5.834388 6.283185 360 0 0 6.283185 6.731984 385 42 51 6.731982 TEST0236 For the dodecahedron, DODEC_SIZE_3D returns dimension information; DODEC_SHAPE_3D returns face and order information. SHAPE_PRINT_3D prints this information. Number of points = 20 Number of edges = 30 Number of faces = 12 Maximum face order = 5 SHAPE_PRINT_3D Information about a polytope. The number of vertices is 20 Vertices: Index X Y Z 1 0.577350 0.577350 0.577350 2 0.577350 0.577350 -0.577350 3 0.577350 -0.577350 0.577350 4 0.577350 -0.577350 -0.577350 5 -0.577350 0.577350 0.577350 6 -0.577350 0.577350 -0.577350 7 -0.577350 -0.577350 0.577350 8 -0.577350 -0.577350 -0.577350 9 0.356822 0.934172 0.000000 10 -0.356822 0.934172 0.000000 11 0.356822 -0.934172 0.000000 12 -0.356822 -0.934172 0.000000 13 0.934172 0.000000 0.356822 14 0.934172 0.000000 -0.356822 15 -0.934172 0.000000 0.356822 16 -0.934172 0.000000 -0.356822 17 0.000000 0.356822 0.934172 18 0.000000 -0.356822 0.934172 19 0.000000 0.356822 -0.934172 20 0.000000 -0.356822 -0.934172 The number of faces is 12 The maximum order of any face is 5 Index Order Indices of Nodes in Face 1 2 3 4 5 1 5 2 9 1 13 14 2 5 5 10 6 16 15 3 5 3 11 4 14 13 4 5 8 12 7 15 16 5 5 3 13 1 17 18 6 5 2 14 4 20 19 7 5 5 15 7 18 17 8 5 8 16 6 19 20 9 5 5 17 1 9 10 10 5 3 18 7 12 11 11 5 2 19 6 10 9 12 5 8 20 4 11 12 TEST0238 DUAL_SIZE_3D finds the "sizes" of the dual of a polyhedron; The cube: Number of vertices: 8 Number of edges: 12 Number of faces : 6 Maximum face order: 4 The dual of the cube: Number of vertices: 6 Number of edges: 12 Number of faces : 8 Maximum face order: 3 The dodecahedron: Number of vertices: 20 Number of edges: 30 Number of faces : 12 Maximum face order: 5 The dual of the dodecahedron: Number of vertices: 12 Number of edges: 30 Number of faces : 20 Maximum face order: 3 The icosahedron: Number of vertices: 12 Number of edges: 30 Number of faces : 20 Maximum face order: 3 The dual of the icosahedron: Number of vertices: 20 Number of edges: 30 Number of faces : 12 Maximum face order: 5 The octahedron: Number of vertices: 6 Number of edges: 12 Number of faces : 8 Maximum face order: 3 The dual of the octahedron: Number of vertices: 8 Number of edges: 12 Number of faces : 6 Maximum face order: 4 The soccer ball: Number of vertices: 60 Number of edges: 90 Number of faces : 32 Maximum face order: 6 The dual of the "soccer ball": Number of vertices: 32 Number of edges: 90 Number of faces : 60 Maximum face order: 3 The tetrahedron: Number of vertices: 4 Number of edges: 6 Number of faces : 4 Maximum face order: 3 The dual of the tetrahedron: Number of vertices: 4 Number of edges: 6 Number of faces : 4 Maximum face order: 3 TEST024 DUAL_SHAPE_3D finds the dual of a polyhedron. Number of points = 20 Number of edges = 30 Number of faces = 12 Maximum face order = 5 Number of points = 12 Number of edges = 30 Number of faces = 20 Maximum face order = 3 SHAPE_PRINT_3D Information about a polytope. The number of vertices is 12 Vertices: Index X Y Z 1 0.850651 0.525731 0.000000 2 -0.850651 0.525731 0.000000 3 0.850651 -0.525731 0.000000 4 -0.850651 -0.525731 0.000000 5 0.525731 0.000000 0.850651 6 0.525731 0.000000 -0.850651 7 -0.525731 0.000000 0.850651 8 -0.525731 0.000000 -0.850651 9 0.000000 0.850651 0.525731 10 0.000000 -0.850651 0.525731 11 0.000000 0.850651 -0.525731 12 0.000000 -0.850651 -0.525731 The number of faces is 20 The maximum order of any face is 3 Index Order Indices of Nodes in Face 1 2 3 1 3 1 9 5 2 3 1 6 11 3 3 3 5 10 4 3 3 12 6 5 3 2 7 9 6 3 2 11 8 7 3 4 10 7 8 3 4 8 12 9 3 1 11 9 10 3 2 9 11 11 3 3 10 12 12 3 4 12 10 13 3 1 5 3 14 3 1 3 6 15 3 2 4 7 16 3 2 8 4 17 3 5 9 7 18 3 5 7 10 19 3 6 8 11 20 3 6 12 8 TEST0243 R8VEC_ANY_NORMAL computes a vector V2 that is normal to a given vector V1. Test ||V1|| ||V2|| V1.V2 1 1.620173 1.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 -0.143118 -0.626624 -0.543533 -3.680490e-01 -0.272129 -0.043324 -0.168777 -7.204881e-02 -0.028719 -0.415404 0.164996 7.224167e-01 0.626624 0.424313 0.313729 4.994709e-02 0.194578 0.083063 0.033109 4.789073e-01 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 2 1.584238 1.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.046148 3.360815e-01 0.300022 0.564204 0.596063 1.374392e-03 0.670986 0.262227 0.070683 1.018018e-02 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 -0.040995 -2.985540e-01 -0.266521 -0.501204 -0.529505 -1.220924e-03 -0.596063 -0.232946 -0.062790 -9.043437e-03 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 3 1.801592 1.000000 0.625496 6.122084e-01 0.089630 0.005470 0.189523 6.643657e-01 0.082757 0.256016 0.599132 1.944950e-01 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 -0.588900 -0.576390 -0.084386 -5.149627e-03 -0.178434 -0.625496 -0.077915 -2.410368e-01 -0.564078 -0.183116 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 4 1.933588 1.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.503168 4.083574e-01 0.626148 0.329931 0.663054 4.347162e-01 0.137380 0.553644 0.288631 1.347329e-01 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 -0.475161 -3.856280e-01 -0.591296 -0.311567 -0.626148 -4.105196e-01 -0.129733 -0.522828 -0.272566 -1.272335e-01 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 5 1.730955 1.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 -0.406054 -2.594731e-01 -0.436339 -0.255586 -0.150533 -5.051024e-01 -0.083214 -0.211614 -0.583244 -5.830015e-01 0.406222 0.259581 0.436520 2.556925e-01 0.150596 0.505312 0.083249 2.117017e-01 0.583486 0.583244 TEST0245 R8VEC_NORMAL_01 computes a vector of normally distributed random numbers. Using initial random number seed = 123456789 Test #1: Call 5 times, 1 value each time. 1 1.248567 2 1.679040 3 -0.472769 4 -0.566060 5 -0.231124 Test #2: Restore the random number seed. Call 5 times, 1 value each time. The results should be identical. 1 1.679040 2 -0.472769 3 -0.566060 4 -0.231124 5 1.212934 Test #3: Restore the random number seed. Call 1 time for 5 values. The results should be identical. 1 1.679040 2 -0.472769 3 -0.566060 4 -0.231124 5 1.212934 Test #4: Restore the random number seed. Call for 2, 1, and 2 values. The results should be identical. 1 1.679040 2 -0.472769 1 -0.566060 1 -0.231124 2 1.212934 Test #5: Number of samples was 1000 Minimum value was -3.029754 Maximum value was 3.328581 Average value was -0.015156 Variance was 0.999674 Expected average 0.000000 Expected variance 1.000000 TEST025: ELLIPSE_POINT_DIST_2D is given a point P, and finds the distance to an ellipse in 2D. The ellipse is (X/A)^2 + (Y/B)^2 = 1 A = 3.000000 B = 2.000000 P DIST -1.200000 3.900000 2.012360 -0.800000 3.600000 1.652439 -0.400000 3.300000 1.313793 0.000000 3.000000 1.000000 0.400000 2.700000 0.715386 0.800000 2.400000 0.465363 1.200000 2.100000 0.257003 1.600000 1.800000 0.099982 2.000000 1.500000 0.007981 2.400000 1.200000 0.000000 2.800000 0.900000 0.097827 3.200000 0.600000 0.311499 3.600000 0.300000 0.623086 4.000000 0.000000 1.000000 4.400000 -0.300000 1.416401 4.800000 -0.600000 1.856811 5.200000 -0.900000 2.312465 TEST0255: ELLIPSE_POINT_NEAR_2D is given a point P, and finds the nearest point PN on an ellipse in 2D. The ellipse is (X/A)^2 + (Y/B)^2 = 1 A = 3.000000 B = 2.000000 P PN -1.200000 3.900000 -0.823689 1.923138 -0.800000 3.600000 -0.583461 1.961810 -0.400000 3.300000 -0.309401 1.989335 0.000000 3.000000 0.000000 2.000000 0.400000 2.700000 0.344958 1.986734 0.800000 2.400000 0.723898 1.940902 1.200000 2.100000 1.132592 1.851994 1.600000 1.800000 1.562334 1.707384 2.000000 1.500000 1.995923 1.493138 2.400000 1.200000 2.400000 1.200000 2.800000 0.900000 2.719790 0.843996 3.200000 0.600000 2.908697 0.489662 3.600000 0.300000 2.984218 0.204879 4.000000 0.000000 3.000000 0.000000 4.400000 -0.300000 2.992027 -0.145716 4.800000 -0.600000 2.976051 -0.252210 5.200000 -0.900000 2.958199 -0.332704 TEST026 ELLIPSE_POINTS_2D returns points on an ellipse; ELLIPSE_AREA_2D returns the area of an ellipse; POLYGON_AREA_2D finds the area of a polygon. Ellipse center: 1 5.000000 2 -2.000000 radii R1 = 3.000000, R2 = 1.000000 and angle PSI = 0.523599 and area = 9.424778 Sample points: Row: 1 2 Col 1 7.598076 -0.500000 2 7.208968 -0.282767 3 6.483564 -0.326967 4 5.532301 -0.625872 5 4.500000 -1.133975 6 3.543820 -1.773922 7 2.809329 -2.448288 8 2.408349 -3.054406 9 2.401924 -3.500000 10 2.791032 -3.717233 11 3.516436 -3.673033 12 4.467699 -3.374128 13 5.500000 -2.866025 14 6.456180 -2.226078 15 7.190671 -1.551712 16 7.591651 -0.945594 For any N, the sampled points define a polygon whose area approximates the ellipse area. N Area 3 3.897114 4 6.000000 5 7.132924 6 7.794229 7 8.209231 8 8.485281 9 8.677633 10 8.816779 11 8.920573 12 9.000000 13 9.062102 14 9.111559 15 9.151574 16 9.184402 17 9.211662 18 9.234544 19 9.253935 20 9.270510 21 9.284788 22 9.297174 23 9.307989 24 9.317486 TEST027 ELLIPSE_POINTS_ARC_2D returns points on an elliptical arc. The ellipse has center 5.000000 -2.000000 radii R1 = 3.000000, R2 = 1.000000 and angle PSI = 0.523599 The arc extends from THETA1 = 1.570796 to THETA2 = 6.283185 Sample points: Row: 1 2 Col 1 4.500000 -1.133975 2 3.543820 -1.773922 3 2.809329 -2.448288 4 2.408349 -3.054406 5 2.401924 -3.500000 6 2.791032 -3.717233 7 3.516436 -3.673033 8 4.467699 -3.374128 9 5.500000 -2.866025 10 6.456180 -2.226078 11 7.190671 -1.551712 12 7.591651 -0.945594 13 7.598076 -0.500000 TEST028 HALFPLANE_CONTAINS_POINT_2D determines whether a halfplane bounded by (XA,YA):(XB,YB) contains the point (X,Y). P1 = 0.000000 0.000000 P2 = 2.000000 0.000000 P = 1.000000 1.000000 Contains? = 1, Correct = 1 P1 = 0.000000 0.000000 P2 = 2.000000 0.000000 P = 1.000000 -1.000000 Contains? = 0, Correct = 0 P1 = -5.000000 -5.000000 P2 = 10.000000 10.000000 P = -1.000000 1.000000 Contains? = 1, Correct = 1 P1 = 3.000000 150.000000 P2 = 1.000000 50.000000 P = 2.000000 200.000000 Contains? = 0, Correct = 0 TEST029 HALFSPACE_IMP_TRIANGLE_INT_3D finds intersection points of an implicit halfspace and a triangle. The implicitly defined bounding plane has the form: A*X + B*Y + C*Z + D = 0. A,B,C,D = 1.000000 -2.000000 -3.000000 6.000000 Case 1 Triangle vertices Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 0.000000 -1.000000 0.000000 3 0.000000 0.000000 -2.000000 Number of intersection points is 0 Intersections: Row: 1 2 3 Col Case 2 Triangle vertices Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 -1.000000 0.000000 3 0.000000 0.000000 -2.000000 Number of intersection points is 1 Intersections: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 Case 3 Triangle vertices Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 0.000000 3.000000 0.000000 3 0.000000 0.000000 2.000000 Number of intersection points is 3 Intersections: Row: 1 2 3 Col 1 0.000000 3.000000 0.000000 2 0.000000 0.000000 2.000000 3 0.000000 0.000000 1.000000 Case 4 Triangle vertices Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 3.000000 Number of intersection points is 3 Intersections: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 3.000000 Case 5 Triangle vertices Row: 1 2 3 Col 1 -8.000000 0.000000 0.000000 2 0.000000 -1.000000 0.000000 3 0.000000 0.000000 -2.000000 Number of intersection points is 3 Intersections: Row: 1 2 3 Col 1 -8.000000 0.000000 0.000000 2 -6.400000 -0.200000 0.000000 3 -7.000000 0.000000 -0.250000 Case 6 Triangle vertices Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 4.000000 Number of intersection points is 4 Intersections: Row: 1 2 3 Col 1 0.000000 3.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 4.000000 4 0.000000 0.000000 1.200000 TEST030 HALFSPACE_NORMAL_TRIANGLE_INT_3D finds intersection points of a normal form halfspace and a triangle. Plane point P: 1 -6.000000 2 0.000000 3 0.000000 Plane normal: 1 2.000000 2 -4.000000 3 -6.000000 Case 1 Triangle vertices: Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 0.000000 -1.000000 0.000000 3 0.000000 0.000000 -2.000000 Number of intersection points is 0 Intersections: Row: 1 2 3 Col Case 2 Triangle vertices: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 -1.000000 0.000000 3 0.000000 0.000000 -2.000000 Number of intersection points is 1 Intersections: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 Case 3 Triangle vertices: Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 0.000000 3.000000 0.000000 3 0.000000 0.000000 2.000000 Number of intersection points is 2 Intersections: Row: 1 2 3 Col 1 0.000000 3.000000 0.000000 2 0.000000 0.000000 2.000000 Case 4 Triangle vertices: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 3.000000 Number of intersection points is 3 Intersections: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 3.000000 Case 5 Triangle vertices: Row: 1 2 3 Col 1 -8.000000 0.000000 0.000000 2 0.000000 -1.000000 0.000000 3 0.000000 0.000000 -2.000000 Number of intersection points is 3 Intersections: Row: 1 2 3 Col 1 -8.000000 0.000000 0.000000 2 -6.400000 -0.200000 0.000000 3 -6.857143 0.000000 -0.285714 Case 6 Triangle vertices: Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 4.000000 Number of intersection points is 4 Intersections: Row: 1 2 3 Col 1 0.000000 3.000000 0.000000 2 0.000000 4.000000 0.000000 3 0.000000 0.000000 4.000000 4 0.000000 0.000000 2.000000 TEST031 HAVERSINE computes the haversine of an angle. Degrees Radians Haversine 0.000000 0.000000 0.000000 30.000000 0.523599 0.066987 60.000000 1.047198 0.250000 90.000000 1.570796 0.500000 120.000000 2.094395 0.750000 150.000000 2.617994 0.933013 180.000000 3.141593 1.000000 210.000000 3.665191 0.933013 240.000000 4.188790 0.750000 270.000000 4.712389 0.500000 300.000000 5.235988 0.250000 330.000000 5.759587 0.066987 360.000000 6.283185 0.000000 TEST0315 HEXAGON_CONTAINS_POINT_2D reports if a hexagon contains a point. We will call the function repeatedly, and draw a sketch of an irregular hexagon in the unit square. ---------------------------------------- ---------------***---------------------- --------------*****--------------------- -------------********------------------- ------------**********------------------ -----------*************---------------- ----------***************--------------- ---------******************------------- --------********************------------ --------**********************---------- --------***********************--------- --------*************************------- --------**************************------ --------****************************---- --------*****************************--- --------*******************************- --------*******************************- --------*******************************- --------*******************************- --------******************************-- --------******************************-- --------******************************-- --------*****************************--- --------*****************************--- ---------****************************--- ----------**************************---- -----------*************************---- ------------************************---- -------------**********************----- --------------*********************----- ---------------********************----- ----------------******************------ ------------------****************------ --------------------**************------ ----------------------***********------- ------------------------*********------- --------------------------*******------- ----------------------------****-------- ------------------------------**-------- ---------------------------------------- TEST032 HEXAGON_SHAPE_2D: points on a unit hexagon. Angle X Y -10.000000 0.907604 -0.160035 0.000000 1.000000 0.000000 10.000000 0.907604 0.160035 20.000000 0.826352 0.300767 30.000000 0.750000 0.433013 40.000000 0.673648 0.565258 50.000000 0.592396 0.705990 60.000000 0.500000 0.866025 70.000000 0.315207 0.866025 80.000000 0.152704 0.866025 90.000000 0.000000 0.866025 100.000000 -0.152704 0.866025 110.000000 -0.315207 0.866025 120.000000 -0.500000 0.866025 130.000000 -0.592396 0.705990 140.000000 -0.673648 0.565258 150.000000 -0.750000 0.433013 160.000000 -0.826352 0.300767 170.000000 -0.907604 0.160035 180.000000 -1.000000 0.000000 190.000000 -0.907604 -0.160035 200.000000 -0.826352 -0.300767 210.000000 -0.750000 -0.433013 220.000000 -0.673648 -0.565258 230.000000 -0.592396 -0.705990 240.000000 -0.500000 -0.866025 250.000000 -0.315207 -0.866025 260.000000 -0.152704 -0.866025 270.000000 -0.000000 -0.866025 280.000000 0.152704 -0.866025 290.000000 0.315207 -0.866025 300.000000 0.500000 -0.866025 310.000000 0.592396 -0.705990 320.000000 0.673648 -0.565258 330.000000 0.750000 -0.433013 340.000000 0.826352 -0.300767 350.000000 0.907604 -0.160035 360.000000 1.000000 0.000000 370.000000 0.907604 0.160035 TEST0321 HEXAGON_VERTICES_2D: the vertices of the unit hexagon. Vertices: Row: 1 2 Col 1 1.000000 0.000000 2 0.500000 0.866025 3 -0.500000 0.866025 4 -1.000000 0.000000 5 -0.500000 -0.866025 6 0.500000 -0.866025 TEST0322 I4COL_FIND_ITEM finds the first occurrence of an item in an I4COL. The matrix of columns: Col: 1 2 3 4 Row 1 11 12 13 14 2 21 22 23 24 3 31 32 33 34 4 41 42 43 44 5 51 52 53 54 Item 34 occurs in row 3 and column 4. Item 12 occurs in row 1 and column 2. Item 90 occurs in row -1 and column -1. TEST0323 I4COL_FIND_PAIR_WRAP finds the first occurrence of a pair of item in an I4COL. Items in the array are ordered by column, and wraparound is allowed. The matrix of columns: Col: 1 2 3 4 Row 1 11 12 13 14 2 21 22 23 24 3 31 32 33 34 4 41 42 43 44 5 51 52 53 54 Item 22 followed by item 32 occurs in row 2 and column 2 Item 32 followed by item 22 occurs in row -1 and column -1 Item 22 followed by item 23 occurs in row -1 and column -1 Item 54 followed by item 14 occurs in row 5 and column 4 Item 54 followed by item 11 occurs in row -1 and column -1 TEST0325 For the icosahedron, ICOS_SIZE returns dimension information; ICOS_SHAPE returns face and order information. SHAPE_PRINT_3D prints this information. Number of points = 12 Number of edges = 30 Number of faces = 20 Maximum face order = 3 SHAPE_PRINT_3D Information about a polytope. The number of vertices is 12 Vertices: Index X Y Z 1 0.850651 0.525731 0.000000 2 0.850651 -0.525731 0.000000 3 0.525731 0.000000 0.850651 4 0.525731 0.000000 -0.850651 5 0.000000 0.850651 0.525731 6 0.000000 0.850651 -0.525731 7 0.000000 -0.850651 0.525731 8 0.000000 -0.850651 -0.525731 9 -0.525731 0.000000 0.850651 10 -0.525731 0.000000 -0.850651 11 -0.850651 0.525731 0.000000 12 -0.850651 -0.525731 0.000000 The number of faces is 20 The maximum order of any face is 3 Index Order Indices of Nodes in Face 1 2 3 1 3 1 2 4 2 3 1 3 2 3 3 1 4 6 4 3 1 5 3 5 3 1 6 5 6 3 2 3 7 7 3 2 7 8 8 3 2 8 4 9 3 3 5 9 10 3 3 9 7 11 3 4 8 10 12 3 4 10 6 13 3 5 6 11 14 3 5 11 9 15 3 6 10 11 16 3 7 9 12 17 3 7 12 8 18 3 8 12 10 19 3 9 11 12 20 3 10 12 11 TEST0327 LINE_EXP_NORMAL_2D determines a unit normal vector to a given explicit line. Point 1: 1 1.000000 2 3.000000 Point 2: 1 4.000000 2 0.000000 Normal vector N: 1 0.707107 2 0.707107 TEST033 LINE_EXP_PERP_2D is given an explicit line (P1,P2), and another point P3. It then finds a point P4 on (P1,P2) so that (P1,P2) is perpendicular to (P3,P4). Point P1: 1 1.000000 2 3.000000 Point P2: 1 4.000000 2 0.000000 Point P3: 1 0.000000 2 0.000000 Point P4: 1 2.000000 2 2.000000 Point P3: 1 5.000000 2 -1.000000 Point P4: 1 5.000000 2 -1.000000 Point P3: 1 5.000000 2 3.000000 Point P4: 1 3.000000 2 1.000000 TEST0335 LINE_EXP_POINT_DIST_2D finds the distance from an explicit line to a point in 2D. Point 1: 1 1.000000 2 3.000000 Point 2: 1 4.000000 2 0.000000 Point: 1 0.000000 2 0.000000 Distance = 2.828427 Point: 1 5.000000 2 -1.000000 Distance = 0.000000 Point: 1 5.000000 2 3.000000 Distance = 2.828427 TEST0336 LINE_EXP_POINT_DIST_3D finds the distance from an explicit line to a point in 3D. Point 1: 1 1.000000 2 3.000000 3 2.000000 Point 2: 1 4.000000 2 0.000000 3 1.000000 Point: 1 0.000000 2 5.000000 3 5.000000 Distance = 2.533980 Point: 1 0.000000 2 -1.000000 3 3.000000 Distance = 3.825125 Point: 1 2.000000 2 1.000000 3 3.000000 Distance = 1.622214 TEST0337 LINE_EXP_POINT_DIST_SIGNED_2D finds the signed distance to a point from an explicit line. Point 1: 1 1.000000 2 3.000000 Point 2: 1 4.000000 2 0.000000 Point: 1 0.000000 2 0.000000 Signed distance = 2.828427 Point: 1 5.000000 2 -1.000000 Signed distance = 0.000000 Point: 1 5.000000 2 3.000000 Signed distance = -2.828427 TEST034 LINE_EXP_POINT_NEAR_2D finds the point on a line nearest in point in 2D. The point P1: 1 1.000000 2 3.000000 The point P2: 1 4.000000 2 0.000000 The point P: 1 0.000000 2 0.000000 Nearest point PN: 1 2.000000 2 2.000000 Distance = 2.828427 Relative line position T = 0.333333 The point P: 1 5.000000 2 -1.000000 Nearest point PN: 1 5.000000 2 -1.000000 Distance = 0.000000 Relative line position T = 1.333333 The point P: 1 5.000000 2 3.000000 Nearest point PN: 1 3.000000 2 1.000000 Distance = 2.828427 Relative line position T = 0.666667 TEST0345 LINE_EXP2IMP_2D converts explicit to implicit lines. LINE_IMP2EXP_2D converts implicit to explicit lines. Implicit line A, B, C = 1.000000 2.000000 3.000000 The point P1: 1 -0.600000 2 -1.200000 The point P2: 1 -1.200000 2 -0.900000 Recovered A, B, C = 0.238095 0.476190 0.714286 TEST0346 LINE_EXP2PAR_2D converts explicit to parametric lines. LINE_PAR2EXP_2D converts parametric to explicit lines. Parametric line: F, G = 1.000000 2.000000 X0, Y0 = 3.000000 4.000000 The point P1: 1 3.000000 2 4.000000 The point P2: 1 4.000000 2 6.000000 Recovered parametric line: F, G = 0.447214 0.894427 X0, Y0 = 3.000000 4.000000 TEST035 LINE_IMP_POINT_DIST_2D finds the distance from a point X Y to a line A * X + B * Y + C = 0. X Y A B C DIST 0.000000 6.000000 2.000000 5.000000 3.000000 6.127946 0.000000 5.000000 2.000000 5.000000 3.000000 5.199469 0.000000 4.000000 2.000000 5.000000 3.000000 4.270993 TEST038 LINES_EXP_ANGLE_3D finds the angle between two explicit lines in 3D; Angle between lines is 1.892547 Angle between lines is 1.570796 TEST0385 LINES_EXP_DIST_3D finds the distance between two explicit lines in 3D. LINES_EXP_DIST_3D_2 finds the distance between two explicit lines in 3D. P1 0.000000 0.000000 0.000000 P2 1.000000 2.000000 0.000000 Q1 0.000000 3.000000 3.000000 Q2 3.000000 0.000000 3.000000 LINES_EXP_DIST_3D = 3.000000 LINES_EXP_DIST_3D_2 = 3.000000 P1 4.000000 -3.000000 0.000000 P2 -8.000000 6.000000 0.000000 Q1 3.000000 4.000000 -1.000000 Q2 3.000000 4.000000 3.000000 LINES_EXP_DIST_3D = 5.000000 LINES_EXP_DIST_3D_2 = 5.000000 TEST03855 LINES_EXP_NEAR_3D finds nearest points on two explicit lines in 3D. P1 0.000000 0.000000 0.000000 P2 1.000000 2.000000 0.000000 Q1 0.000000 3.000000 3.000000 Q2 3.000000 0.000000 3.000000 PN 1.000000 2.000000 0.000000 QN 1.000000 2.000000 3.000000 P1 4.000000 -3.000000 0.000000 P2 -8.000000 6.000000 0.000000 Q1 3.000000 4.000000 -1.000000 Q2 3.000000 4.000000 3.000000 PN 0.000000 0.000000 0.000000 QN 3.000000 4.000000 0.000000 TEST0386 LINES_EXP_EQUAL_2D tries to determine if two explicit lines in 2D are equal. P1 0.000000 0.000000 P2 1.000000 2.000000 Q1 0.000000 0.000000 Q2 1.000000 2.000000 The lines are equal. P1 0.000000 0.000000 P2 1.000000 2.000000 Q1 1.000000 2.000000 Q2 0.000000 0.000000 The lines are equal. P1 0.000000 0.000000 P2 1.000000 2.000000 Q1 0.000000 0.000000 Q2 2.000000 4.000000 The lines are equal. P1 0.000000 0.000000 P2 1.000000 2.000000 Q1 7.000000 14.000000 Q2 5.500000 11.000000 The lines are equal. P1 0.000000 0.000000 P2 1.000000 2.000000 Q1 1.000000 2.000000 Q2 3.000000 5.000000 The lines are distinct. P1 0.000000 0.000000 P2 1.000000 2.000000 Q1 0.000000 10.000000 Q2 1.000000 12.000000 The lines are distinct. TEST039 LINES_EXP_INT_2D finds intersections of two explicit lines in 2D. P1 0.000000 2.000000 P2 4.000000 0.000000 Q1 0.000000 -1.000000 Q2 1.000000 0.000000 Intersection at 2.000000 1.000000 P1 0.000000 2.000000 P2 4.000000 0.000000 Q1 0.000000 0.250000 Q2 0.500000 0.000000 Lines are parallel, no intersection. P1 0.000000 2.000000 P2 4.000000 0.000000 Q1 0.000000 2.000000 Q2 4.000000 0.000000 Lines are coincident. TEST040 LINES_IMP_ANGLE_2D finds the angle between two lines written in implicit form. Line 1 coefficients: 1.000000 2.000000 -4.000000 Line 2 coefficients: 1.000000 -1.000000 -1.000000 Angle between lines is 108.434949 Line 1 coefficients: 1.000000 2.000000 -4.000000 Line 2 coefficients: 2.000000 4.000000 -1.000000 Angle between lines is 0.000001 Line 1 coefficients: 1.000000 2.000000 -4.000000 Line 2 coefficients: -3.000000 -6.000000 12.000000 Angle between lines is 179.999999 TEST041 LINES_IMP_DIST_3D finds the distance between two implicit lines in 2D. A1 B1 C1 A2 B2 C2 DIST 4.000000 -1.000000 3.000000 4.000000 -1.000000 12.000000 2.182821 2.000000 -1.000000 0.000000 4.000000 -2.000000 6.000000 1.341641 1.000000 2.000000 2.000000 2.000000 3.000000 1.000000 0.000000 TEST0415 LINES_IMP_INT_2D finds the intersection of two lines written in implicit form. Line 1 coefficients: 1.000000 2.000000 -4.000000 Line 2 coefficients: 1.000000 -1.000000 -1.000000 Intersection at 2.000000 1.000000 Line 1 coefficients: 1.000000 2.000000 -4.000000 Line 2 coefficients: 2.000000 4.000000 -1.000000 Lines are parallel, no intersection. Line 1 coefficients: 1.000000 2.000000 -4.000000 Line 2 coefficients: -3.000000 -6.000000 12.000000 Lines are coincident. TEST0416 LINES_PAR_INT_2D finds the intersection of two lines written in parametric form. Line 1 parameters: 0.000000 1.000000 2.000000 1.000000 Line 2 parameters: 10.000000 -2.000000 1.000000 1.000000 Line 1 evaluated at T1: T1 = 13.000000 X(T1)= 26.000000 Y(T1)= 14.000000 Line 2 evaluated at T2: T2 = 16.000000 X(T2)= 26.000000 Y(T2)= 14.000000 Reported intersection: PINT(1) = 26.000000 PINT(2) = 14.000000 TEST0418 SEGMENTS_CURVATURE_2D computes the local curvature defined by the line segments [P1,P2] and [P2,P3]. Our three points are: P1 = (0,0) P2 = (1,0) P3 = (C,S) C = cosine ( theta), S = sine ( theta ). Test Theta Curvature 1 0.000000 2.000000 2 30.000000 1.931852 3 60.000000 1.732051 4 90.000000 1.414214 5 120.000000 1.000000 6 150.000000 0.517638 7 180.000000 0.000000 8 210.000000 0.517638 9 240.000000 1.000000 10 270.000000 1.414214 11 300.000000 1.732051 12 330.000000 1.931852 13 360.000000 2.000000 TEST042 SEGMENTS_DIST_2D computes the distance between line segments in 2D. Same slope, different intercepts. P1 = 2.000000 3.000000 P2 = 8.000000 6.000000 Q1 = 8.000000 3.000000 Q2 = 14.000000 6.000000 Distance([P1,P2],[Q1,Q2]) = 2.683282 Same slope, same intercepts, overlapping. Distance should be 0. P1 = 2.000000 3.000000 P2 = 8.000000 6.000000 Q1 = 4.000000 4.000000 Q2 = 14.000000 9.000000 Distance([P1,P2],[Q1,Q2]) = 0.000000 Same slope, same intercepts, disjoint. Distance should be sqrt(45)=6.7082038 P1 = 2.000000 3.000000 P2 = 8.000000 6.000000 Q1 = 14.000000 9.000000 Q2 = 16.000000 10.000000 Distance([P1,P2],[Q1,Q2]) = 6.708204 Different slopes, intersecting. Distance should be 0. P1 = 2.000000 3.000000 P2 = 8.000000 6.000000 Q1 = 0.000000 8.000000 Q2 = 5.000000 3.000000 Distance([P1,P2],[Q1,Q2]) = 0.000000 Different slopes, not intersecting. P1 = 2.000000 3.000000 P2 = 8.000000 6.000000 Q1 = 7.000000 3.000000 Q2 = 9.000000 -1.000000 Distance([P1,P2],[Q1,Q2]) = 2.236068 Simple problem. Distance should be 0 P1 = 57.000000 53.000000 P2 = 58.000000 53.000000 Q1 = 65.000000 45.000000 Q2 = 57.000000 53.000000 Distance([P1,P2],[Q1,Q2]) = 0.000000 Same data, translated by 50. Distance should be 0 P1 = 7.000000 3.000000 P2 = 8.000000 3.000000 Q1 = 15.000000 -5.000000 Q2 = 7.000000 3.000000 Distance([P1,P2],[Q1,Q2]) = 0.000000 Diagonal and horizontal. Distance should be sqrt(2500/2)=35.355339 P1 = 0.000000 0.000000 P2 = 100.000000 100.000000 Q1 = 50.000000 0.000000 Q2 = 60.000000 0.000000 Distance([P1,P2],[Q1,Q2]) = 35.355339 Same data, except first segment extended. Distance should be sqrt(2500/2)=35.355339 P1 = -10.000000 -10.000000 P2 = 100.000000 100.000000 Q1 = 50.000000 0.000000 Q2 = 60.000000 0.000000 Distance([P1,P2],[Q1,Q2]) = 35.355339 TEST043 SEGMENTS_DIST_3D computes the distance between line segments in 3D. Case Computed True 1 5.000000 5.0 1 0.000000 0.0 3 3.000000 3.0 4 0.000000 0.0 5 1.000000 1.0 6 3.000000 3.0 7 1.000000 1.0 8 10.000000 10.0 9 4.000000 4.0 TEST044 SEGMENTS_INT_1D determines the intersection [R1,R2] of line segments [P1,P2] and [Q1,Q2] in 1D. DIST is negative for overlap, 0 for point intersection, positive if there is no overlap. Test P1 P2 Q1 Q2 R1 R2 DIST 1 -1.000000 1.000000 -1.000000 1.000000 -1.000000 1.000000 -2.000000 2 -1.000000 1.000000 3.000000 2.000000 2.000000 1.000000 1.000000 3 -1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 0.000000 4 -1.000000 1.000000 0.500000 -3.000000 -1.000000 0.500000 -1.500000 5 -1.000000 1.000000 0.250000 0.500000 0.250000 0.500000 -0.250000 6 -1.000000 1.000000 0.500000 0.500000 0.500000 0.500000 0.000000 7 -1.000000 1.000000 2.000000 2.000000 2.000000 1.000000 1.000000 TEST045 SEGMENTS_INT_2D searches for an intersection of two line segments in 2D. All tests use the same line segment 1: P1 = -1.000000 3.000000 P2 = 1.000000 1.000000 Q1 = -1.000000 1.000000 Q2 = 1.000000 -1.000000 The line segments do not intersect. Q1 = 3.000000 -1.000000 Q2 = 2.000000 0.000000 The line segments do not intersect. Q1 = 0.000000 0.000000 Q2 = 0.000000 9.000000 The line segments do not intersect. Q1 = 1.000000 2.000000 Q2 = 3.000000 2.000000 The line segments do not intersect. TEST046 MINABS finds the minimum of a function F(X) = a * ABS ( X ) + B within an interval, given three data points. The points lie on a straight line. XMIN, YMIN = 9.000000 2.000000 The points straddle a minimum. XMIN, YMIN = 7.000000 2.000000 The points straddle a maximum. XMIN, YMIN = 2.000000 5.000000 TEST047 MINQUAD finds the minimum of a function F(X) = A * X * X + B * X + C within an interval, given three data points. The minimum lies in the interval. X1, Y1 = 0.000000 5.000000 X2, Y2 = 2.000000 5.000000 X3, Y3 = 3.000000 8.000000 XMIN, YMIN = 1.000000 4.000000 The minimum is to the left of the interval X1, Y1 = 2.000000 5.000000 X2, Y2 = 4.000000 13.000000 X3, Y3 = 5.000000 20.000000 XMIN, YMIN = 2.000000 5.000000 The function is flat. X1, Y1 = 11.000000 6.000000 X2, Y2 = 6.000000 6.000000 X3, Y3 = 2.000000 6.000000 XMIN, YMIN = 11.000000 6.000000 The function has a maximum. X1, Y1 = 0.000000 3.000000 X2, Y2 = 2.000000 3.000000 X3, Y3 = 3.000000 0.000000 XMIN, YMIN = 3.000000 0.000000 TEST0475 For the octahedron: OCTAHEDRON_SIZE_3D returns dimension information; OCTAHEDRON_SHAPE_3D returns face and order information. We will use this information to compute the areas and centers of each face. Number of points = 6 Number of edges = 12 Number of faces = 8 Maximum face order = 3 Face Order Area 1 3 0.866025 2 3 0.866025 3 3 0.866025 4 3 0.866025 5 3 0.866025 6 3 0.866025 7 3 0.866025 8 3 0.866025 Face Center 1 0.333333 -0.333333 -0.333333 2 0.333333 0.333333 -0.333333 3 -0.333333 0.333333 -0.333333 4 -0.333333 -0.333333 -0.333333 5 0.333333 -0.333333 0.333333 6 0.333333 0.333333 0.333333 7 -0.333333 0.333333 0.333333 8 -0.333333 -0.333333 0.333333 TEST0477 PARALLELOGRAM_AREA_2D finds the area of a parallelogram in 2D. Vertices: Row: 1 2 Col 1 2.000000 7.000000 2 5.000000 7.000000 3 6.000000 9.000000 4 3.000000 9.000000 AREA = 6.000000 TEST0478 PARALLELOGRAM_AREA_3D finds the area of a parallelogram in 3D. Vertices: Row: 1 2 3 Col 1 1.000000 2.000000 3.000000 2 2.414214 3.414214 3.000000 3 1.707107 2.707107 4.000000 4 0.292893 0.292893 4.000000 AREA = 2.000000 TEST048 PARALLELOGRAM_CONTAINS_POINT_2D determines if a point is within a parallelogram in 2D. P Inside? 1.000000 0.500000 1 2.000000 0.000000 0 0.500000 -0.100000 0 0.100000 0.500000 0 TEST0485 PARALLELOGRAM_CONTAINS_POINT_2D reports if a parallelogram contains a point. We will call the function repeatedly, and draw a sketch of the unit square. --------------------------------------------------- ---------------------------------------*----------- --------------------------------------**----------- -------------------------------------**------------ ------------------------------------***------------ -----------------------------------****------------ ----------------------------------****------------- ---------------------------------*****------------- --------------------------------******------------- -------------------------------******-------------- -------------------------------******-------------- -----------------------------********-------------- ----------------------------********--------------- ---------------------------*********--------------- --------------------------**********--------------- --------------------------**********--------------- -------------------------**********---------------- -----------------------************---------------- ----------------------************----------------- ----------------------************----------------- --------------------**************----------------- --------------------*************------------------ --------------------*************------------------ --------------------*************------------------ -------------------*************------------------- -------------------*************------------------- -------------------*************------------------- ------------------**************------------------- ------------------*************-------------------- -----------------**************-------------------- -----------------**************-------------------- -----------------*************--------------------- ----------------************----------------------- ----------------***********------------------------ ----------------**********------------------------- ----------------*********-------------------------- ---------------**********-------------------------- ---------------********---------------------------- --------------********----------------------------- --------------********----------------------------- --------------******------------------------------- -------------******-------------------------------- -------------******-------------------------------- -------------****---------------------------------- -------------***----------------------------------- ------------****----------------------------------- ------------**------------------------------------- ------------*-------------------------------------- -----------**-------------------------------------- -----------*--------------------------------------- ----------*---------------------------------------- TEST049 PARALLELOGRAM_CONTAINS_POINT_3D determines if a point is within a parallelogram in 3D. P Inside? 1.000000 1.000000 0.500000 1 3.000000 3.000000 0.000000 0 0.500000 0.500000 -0.100000 0 0.100000 0.100000 0.500000 0 1.500000 1.600000 0.500000 0 TEST0493 PARABOLA_EX finds the extreme value of a parabola determined by three points. PARABOLA_EX2 finds the extreme value of a parabola determined by three points. Parabolic coefficients (A,B,C) = 2.000000 -4.000000 10.000000 X, Y data X1, Y1 = 1.000000 8.000000 X2, Y2 = 2.000000 10.000000 X3, Y3 = 3.000000 16.000000 PARABOLA_EX returns (XMIN,YMIN) = 1.000000 8.000000 PARABOLA_EX2 returns (XMIN,YMIN) = 1.000000 8.000000 and (A,B,C) = 2.000000 -4.000000 10.000000 TEST0495 PARALLELEPIPED_POINT_DIST_3D computes the distance from a point to a box (parallelipiped) in 3D. The 4 box corners that are specified: 1 0.000000 0.000000 0.000000 2 2.000000 0.000000 0.000000 3 0.000000 8.000000 0.000000 4 0.000000 0.000000 1.000000 I P Distance to box 1 1.000000 4.000000 0.500000 1.118034 2 1.000000 0.000000 0.500000 0.000000 3 0.000000 4.000000 1.000000 0.000000 4 2.000000 8.000000 1.000000 0.000000 5 -0.500000 4.000000 0.500000 0.707107 6 1.000000 -1.000000 -1.000000 1.414214 7 3.000000 9.000000 2.000000 1.732051 TEST050 PLANE_EXP_NORMAL_3D finds the normal to a plane. Three points on the plane: P1: -10.560000 -10.560000 78.090000 P2: 44.660000 -65.770000 0.000000 P3: 44.660000 44.660000 0.000000 The normal vector: 1 0.816487 2 0.000000 3 0.577364 TEST051 PLANE_EXP2IMP_3D puts a plane defined by 3 points into A*X+B*Y+C*Z+D = 0 form. P1, P2, P3: -1.000000 0.000000 -1.000000 -4.000000 0.000000 0.000000 -20.000000 2.000000 4.000000 (A,B,C,D)= -2.000000 -4.000000 -6.000000 -8.000000 Correct answer is a multiple of 1, 2, 3, 4. P1, P2, P3: -16.000000 2.000000 4.000000 0.000000 0.000000 0.000000 4.000000 -2.000000 0.000000 (A,B,C,D)= -8.000000 -16.000000 -24.000000 0.000000 Correct answer is a multiple of 1, 2, 3, 0. TEST052 PLANE_EXP2NORMAL_3D puts a plane defined by 3 points into point, normal form. P1, P2, P3: -1.000000 0.000000 -1.000000 -4.000000 0.000000 0.000000 -20.000000 2.000000 4.000000 The point PP: 1 -1.000000 2 0.000000 3 -1.000000 Normal vector: 1 -0.267261 2 -0.534522 3 -0.801784 P1, P2, P3: -16.000000 2.000000 4.000000 0.000000 0.000000 0.000000 4.000000 -2.000000 0.000000 The point PP: 1 -16.000000 2 2.000000 3 4.000000 Normal vector: 1 -0.267261 2 -0.534522 3 -0.801784 TEST053 PLANE_EXP_PROJECT_3D projects a point through a focus point into a plane. PO, PP, IVIS 0.000000 2.000000 2.000000 0.000000 0.500000 0.500000 3 4.000000 5.000000 -8.000000 4.000000 5.000000 -8.000000 3 0.250000 0.250000 0.250000 0.333333 0.333333 0.333333 1 5.000000 -2.000000 -3.000000 7647803531873692.000000 -3059121412749477.000000 -4588682119124216.000000 1 -2.000000 0.000000 0.000000 1.000000 0.000000 0.000000 -1 TEST054 PLANE_IMP2EXP_3D converts a plane in implicit (A,B,C,D) form to explicit form. (A,B,C,D) = 1.000000 -2.000000 -3.000000 6.000000 P1, P2, P3: -6.000000 0.000000 0.000000 -6.963624 -0.148250 -0.222375 -6.000000 -0.832050 0.554700 TEST055 PLANE_IMP2NORMAL_3D converts a plane in implicit (A,B,C,D) form to point, normal form. Input: (A,B,C,D) = 1.000000 -2.000000 -3.000000 6.000000 The point PP: 1 -6.000000 2 0.000000 3 0.000000 Normal vector: 1 0.267261 2 -0.534522 3 -0.801784 TEST056 PLANE_IMP_LINE_PAR_INT_3D finds the intersection of an implicit plane and a parametric line, in 3D. The plane and line intersect at 7.000000 2.000000 3.000000 Expected answer: The plane and line intersect at 7, 2, 3. TEST057 PLANE_IMP_SEGMENT_NEAR_3D finds the point on a line segment nearest a plane. The distance between the plane and the line segment is 0.000000 A nearest point on the line segment is 7.000000 2.000000 3.000000 A nearest point on the plane is 7.000000 2.000000 3.000000 The distance between the plane and the line segment is 4.008919 A nearest point on the line segment is 5.000000 1.000000 -2.000000 A nearest point on the plane is 3.928571 3.142857 1.214286 TEST058 PLANE_IMP_POINT_DIST_3D computes the distance between an implicit plane and a point in 3D; PLANE_IMP_POINT_DIST_SIGNED 3D computes the signed distance between an implicit plane and a point in 3D. For all tests, we use the implicit plane with (A,B,C,D) = 0.000000 0.000000 1.000000 -10.000000 (X,Y,Z) DISTANCE SIGNED_DISTANCE -12.000000 14.000000 0.000000 10.000000 -10.000000 7.000000 8.000000 9.000000 1.000000 -1.000000 1.000000 2.000000 10.000000 0.000000 0.000000 0.000000 0.000000 12.000000 2.000000 2.000000 TEST059 PLANE_IMP_TRIANGLE_NEAR_3D finds the nearest points on an implicit plane and a triangle. Implicit plane: A*X + B*Y + C*Z + D = 0. A,B,C,D = 1.000000 -2.000000 -3.000000 6.000000 Triangle vertices: Row: 1 2 3 Col 1 3.000000 0.000000 -7.000000 2 13.000000 -4.000000 -1.000000 3 5.000000 1.000000 -2.000000 Triangle to plane distance is 4.008919 Nearest points: Row: 1 2 3 Col 1 5.000000 1.000000 -2.000000 2 3.928571 3.142857 1.214286 3 5.000000 1.000000 -2.000000 4 3.928571 3.142857 1.214286 Triangle vertices: Row: 1 2 3 Col 1 3.000000 0.000000 -7.000000 2 13.000000 -4.000000 -1.000000 3 9.000000 3.000000 8.000000 Triangle to plane distance is 0.000000 Nearest points: Row: 1 2 3 Col 1 10.333333 0.666667 5.000000 2 7.000000 2.000000 3.000000 TEST060 PLANE_IMP_TRIANGLE_INT_3D finds the intersection points of an implicit plane and a triangle. The implicit plane: A*X + B*Y + C*Z + D = 0. A,B,C,D = 1.000000 -2.000000 -3.000000 6.000000 Case 1 Triangle vertices: Row: 1 2 3 Col 1 3.000000 0.000000 -7.000000 2 13.000000 -4.000000 -1.000000 3 5.000000 1.000000 -2.000000 Number of intersection points is 0 Intersection points: Row: 1 2 3 Col Case 2 Triangle vertices: Row: 1 2 3 Col 1 3.000000 0.000000 -7.000000 2 13.000000 -4.000000 -1.000000 3 9.000000 3.000000 8.000000 Number of intersection points is 2 Intersection points: Row: 1 2 3 Col 1 7.000000 2.000000 3.000000 2 10.333333 0.666667 5.000000 Case 3 Triangle vertices: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 3.000000 0.000000 3 0.000000 0.000000 2.000000 Number of intersection points is 3 Intersection points: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 3.000000 0.000000 3 0.000000 0.000000 2.000000 Case 4 Triangle vertices: Row: 1 2 3 Col 1 -4.000000 1.000000 0.000000 2 0.000000 6.000000 -2.000000 3 0.000000 0.000000 1.000000 Number of intersection points is 2 Intersection points: Row: 1 2 3 Col 1 -4.000000 1.000000 0.000000 2 0.000000 6.000000 -2.000000 TEST061 PLANE_NORMAL_BASIS_3D, given a plane in point, normal form (P,N), finds two unit vectors Q and R that "lie" in the plane and are mutually orthogonal. Data for test 1: Point PP: 1 0.218418 2 0.956318 3 0.829509 Normal vector N: 1 0.800502 2 0.591876 3 0.094229 Vector PQ: 1 -0.075768 2 -0.056021 3 0.995551 Vector PR: 1 -0.594521 2 0.804080 3 0.000000 Dot product matrix: Col: 1 2 3 Row 1 1 0 -5.55112e-17 2 0 1 0 3 -5.55112e-17 0 1 Dot product matrix: Col: 1 2 3 Row 1 1 -3.46945e-18 5.55112e-17 2 -3.46945e-18 1 -6.93889e-18 3 5.55112e-17 -6.93889e-18 1 Dot product matrix: Col: 1 2 3 Row 1 1 5.42101e-20 0 2 5.42101e-20 1 0 3 0 0 1 Dot product matrix: Col: 1 2 3 Row 1 1 -1.73472e-18 0 2 -1.73472e-18 1 0 3 0 0 1 Dot product matrix: Col: 1 2 3 Row 1 1 0 5.55112e-17 2 0 1 0 3 5.55112e-17 0 1 TEST0615 PLANE_NORMAL_LINE_EXP_INT_3D finds the intersection of a normal plane and an explicit line, in 3D. Plane point PP: 1 -1.000000 2 1.000000 3 1.000000 Plane Normal: 1 0.267261 2 -0.534522 3 -0.801784 Line point P1: 1 3.000000 2 0.000000 3 -7.000000 Line point P2: 1 5.000000 2 1.000000 3 -2.000000 The plane and line intersect at 7.000000 2.000000 3.000000 Expected answer: The plane and line intersect at 7, 2, 3. TEST0616 For a normal plane, with point PP and NORMAL vector, and in-plane basis vectors PQ and PR, PLANE_NORMAL_QR_TO_XYZ converts QR to XYZ coordinates; PLANE_NORMAL_XYZ_TO_QR converts XYZ to QR coordinates. Maximum difference for 5 points was 0.000000 TEST0617 PLANE_NORMAL_TETRAHEDRON_INTERSECT determines the intersection of a plane and tetrahedron. Plane normal vector number 1 0.000000 0.000000 1.000000 Point on plane: 0.000000 0.000000 0.000000 Number of intersection points = 3 1 0.000000 0.000000 0.000000 2 1.000000 0.000000 0.000000 3 0.000000 1.000000 0.000000 Point on plane: 0.000000 0.000000 0.200000 Number of intersection points = 3 1 0.000000 0.000000 0.200000 2 0.800000 0.000000 0.200000 3 0.000000 0.800000 0.200000 Point on plane: 0.000000 0.000000 0.400000 Number of intersection points = 3 1 0.000000 0.000000 0.400000 2 0.600000 0.000000 0.400000 3 0.000000 0.600000 0.400000 Point on plane: 0.000000 0.000000 0.600000 Number of intersection points = 3 1 0.000000 0.000000 0.600000 2 0.400000 0.000000 0.600000 3 0.000000 0.400000 0.600000 Point on plane: 0.000000 0.000000 0.800000 Number of intersection points = 3 1 0.000000 0.000000 0.800000 2 0.200000 0.000000 0.800000 3 0.000000 0.200000 0.800000 Point on plane: 0.000000 0.000000 1.000000 Number of intersection points = 1 1 0.000000 0.000000 1.000000 Point on plane: 0.000000 0.000000 1.200000 Number of intersection points = 0 Plane normal vector number 2 0.707107 0.707107 0.000000 Point on plane: 0.000000 0.000000 0.000000 Number of intersection points = 2 1 0.000000 0.000000 0.000000 2 0.000000 0.000000 1.000000 Point on plane: 0.141421 0.141421 0.000000 Number of intersection points = 4 1 0.282843 0.000000 0.000000 2 0.000000 0.282843 0.000000 3 0.000000 0.282843 0.717157 4 0.282843 0.000000 0.717157 Point on plane: 0.282843 0.282843 0.000000 Number of intersection points = 4 1 0.565685 0.000000 0.000000 2 0.000000 0.565685 0.000000 3 0.000000 0.565685 0.434315 4 0.565685 0.000000 0.434315 Point on plane: 0.424264 0.424264 0.000000 Number of intersection points = 4 1 0.848528 0.000000 0.000000 2 0.000000 0.848528 0.000000 3 0.000000 0.848528 0.151472 4 0.848528 0.000000 0.151472 Point on plane: 0.565685 0.565685 0.000000 Number of intersection points = 0 Point on plane: 0.707107 0.707107 0.000000 Number of intersection points = 0 Point on plane: 0.848528 0.848528 0.000000 Number of intersection points = 0 TEST062 PLANE_NORMAL_TRIANGLE_INT_3D finds the intersection points of a normal form plane and a triangle. The point PP: 1 0.000000 2 0.000000 3 2.000000 The normal vector N: 1 1.000000 2 -2.000000 3 -3.000000 Case 1 Triangle vertices: Row: 1 2 3 Col 1 3.000000 0.000000 -7.000000 2 13.000000 -4.000000 -1.000000 3 5.000000 1.000000 -2.000000 Number of intersection points is 0 Intersection points: Row: 1 2 3 Col Case 2 Triangle vertices: Row: 1 2 3 Col 1 3.000000 0.000000 -7.000000 2 13.000000 -4.000000 -1.000000 3 9.000000 3.000000 8.000000 Number of intersection points is 2 Intersection points: Row: 1 2 3 Col 1 7.000000 2.000000 3.000000 2 10.333333 0.666667 5.000000 Case 3 Triangle vertices: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 3.000000 0.000000 3 0.000000 0.000000 2.000000 Number of intersection points is 3 Intersection points: Row: 1 2 3 Col 1 -6.000000 0.000000 0.000000 2 0.000000 3.000000 0.000000 3 0.000000 0.000000 2.000000 Case 4 Triangle vertices: Row: 1 2 3 Col 1 -4.000000 1.000000 0.000000 2 0.000000 6.000000 -2.000000 3 0.000000 0.000000 1.000000 Number of intersection points is 2 Intersection points: Row: 1 2 3 Col 1 -4.000000 1.000000 0.000000 2 0.000000 6.000000 -2.000000 TEST063 PLANE_NORMAL2EXP_3D puts a plane defined by point, normal form into explicit form. The point PP: 1 -1.000000 2 0.000000 3 -1.000000 Normal vector: 1 -0.267261 2 -0.534523 3 -0.801784 P1, P2, P3: -1.000000 0.000000 -1.000000 -1.963624 0.148250 -0.777625 -1.000000 -0.832050 -0.445300 TEST064 PLANE_NORMAL2IMP_3D puts a plane defined by point, normal form into implicit ABCD form. The point PP: 1 -1.000000 2 0.000000 3 -1.000000 Normal vector: 1 -0.267261 2 -0.534523 3 -0.801784 Output: (A,B,C,D)= -0.267261 -0.534523 -0.801784 -1.069045 The point PP: 1 -16.000000 2 2.000000 3 4.000000 Normal vector: 1 -0.267261 2 -0.534523 3 -0.801784 Output: (A,B,C,D)= -0.267261 -0.534523 -0.801784 0.000001 TEST065 POINTS_CENTROID_2D computes the centroid of a discrete set of points. The points: Row: 1 2 Col 1 7.000000 3.000000 2 4.000000 7.000000 3 5.000000 13.000000 4 2.000000 7.000000 5 6.000000 9.000000 6 12.000000 8.000000 7 3.000000 4.000000 8 6.000000 6.000000 9 3.000000 10.000000 10 8.000000 7.000000 11 5.000000 13.000000 12 10.000000 6.000000 The centroid is point #:5 TEST066 POINTS_COLIN_2D estimates the colinearity of three points. Points almost on a line: Expect COLIN to be close to 0 0.000000 0.000000 10.000000 10.000000 5.000000 4.990000 Colinearity index = 0.001299 Two points close, one far: Expect COLIN to be close to 0 0.000000 0.000000 0.000000 1.000000 100.000000 0.000000 Colinearity index = 0.025722 Points on an equilateral triangle: Expect COLIN to be close to 1 0.000000 0.000000 1.000000 0.000000 0.500000 0.866025 Colinearity index = 1.000000 GEOMETRY_TEST068 POINTS_DIST_SPHERE_3D measures the distance between two points on a sphere. All tests uses RADIUS = 3957.000000 which is the radius of the earth in miles. Distance from Atlanta, Georgia to North Pole is 3923.91118352 3923.91118352 3923.91118352 to South Pole is 8507.37094673 8507.37094673 8507.37094673 to Timbuktu is 4995.76351265 4995.76351265 4995.76351265 to San Antonio, Texas is 974.43026414 974.43026414 974.43026414 to Savannah, Georgia is 114.22379279 114.22379279 114.22379279 Distance from North Pole to South Pole is 12431.28213025 12431.28213025 12431.28213025 to Timbuktu is 5054.23702166 5054.23702166 5054.23702166 to San Antonio, Texas is 4184.04727254 4184.04727254 4184.04727254 to Savannah, Georgia is 3999.88012987 3999.88012987 3999.88012987 Distance from South Pole to Timbuktu is 7377.04510859 7377.04510859 7377.04510859 to San Antonio, Texas is 8247.23485771 8247.23485771 8247.23485771 to Savannah, Georgia is 8431.40200038 8431.40200038 8431.40200038 Distance from Timbuktu to San Antonio, Texas is 5969.44112133 5969.44112133 5969.44112133 to Savannah, Georgia is 4922.93556095 4922.93556095 4922.93556095 Distance from San Antonio, Texas to Savannah, Georgia is 1047.81549868 1047.81549868 1047.81549868 TEST0685 POLAR_TO_XY converts (R,Theta) to (X,Y); XY_TO_POLAR converts (X,Y) to (R,Theta). X Y ===> R T => X Y -0.563163 0.912635 1.072407 2.123676 -0.563163 0.912635 0.659018 0.123391 0.670470 0.185091 0.659018 0.123391 -0.169386 -0.867763 0.884140 -1.763571 -0.169386 -0.867763 -0.484844 -0.780086 0.918482 -2.126894 -0.484844 -0.780086 -0.912342 0.267931 0.950871 2.855949 -0.912342 0.267931 -0.876546 -0.100922 0.882336 -3.026961 -0.876546 -0.100922 -0.197387 0.509347 0.546256 1.940507 -0.197387 0.509347 0.594574 -0.996323 1.160249 -1.032757 0.594574 -0.996323 0.795008 -0.298495 0.849198 -0.359176 0.795008 -0.298495 -0.810910 -0.972766 1.266432 -2.265700 -0.810910 -0.972766 TEST0755 For a polygon in 2D: POLYGON_1_2D integrates 1 POLYGON_X_2D integrates X POLYGON_Y_2D integrates Y POLYGON_XX_2D integrates X*X POLYGON_XY_2D integrates X*Y POLYGON_YY_2D integrates Y*Y The polygon vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 1.000000 1.000000 4 0.000000 1.000000 F(X,Y) Integral 1 1.000000 X 0.500000 Y 0.500000 X*X 0.333333 X*Y 0.250000 Y*Y 0.333333 TEST0757 For a polygon in 2D: POLYGON_ANGLES_2D computes the angles. Number of polygonal vertices = 6 The polygon vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 2.000000 1.000000 4 3.000000 0.000000 5 3.000000 2.000000 6 1.000000 2.000000 Polygonal angles in degrees: 1 63.434949 2 135.000000 3 270.000000 4 45.000000 5 90.000000 6 116.565051 TEST076 For a polygon in 2D: POLYGON_AREA_2D computes the area. Number of polygonal vertices = 4 The polygon vertices: Row: 1 2 Col 1 1.000000 0.000000 2 2.000000 1.000000 3 1.000000 2.000000 4 0.000000 1.000000 Exact area is 2.000000 The computed area is 2.000000 Number of polygonal vertices = 8 The polygon vertices: Row: 1 2 Col 1 0.000000 0.000000 2 3.000000 0.000000 3 3.000000 3.000000 4 2.000000 3.000000 5 2.000000 1.000000 6 1.000000 1.000000 7 1.000000 2.000000 8 0.000000 2.000000 Exact area is 6.000000 The computed area is 6.000000 TEST0765 For a polygon in 2D: POLYGON_AREA_2D_2 computes the area. Number of polygonal vertices = 4 The polygon vertices: Row: 1 2 Col 1 1.000000 0.000000 2 2.000000 1.000000 3 1.000000 2.000000 4 0.000000 1.000000 Exact area is 2.000000 The computed area is 2.000000 Number of polygonal vertices = 8 The polygon vertices: Row: 1 2 Col 1 0.000000 0.000000 2 3.000000 0.000000 3 3.000000 3.000000 4 2.000000 3.000000 5 2.000000 1.000000 6 1.000000 1.000000 7 1.000000 2.000000 8 0.000000 2.000000 Exact area is 6.000000 The computed area is 6.000000 TEST078 For a polygon in 3D: POLYGON_AREA_3D computes the area; The polygon vertices: Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 2.000000 1.000000 1.000000 3 1.000000 2.000000 1.000000 4 0.000000 1.000000 0.000000 Exact area is 2.449490 The computed area is 2.449490 The polygon vertices: Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 2.626790 1.260090 -0.715657 3 1.481530 3.973000 -0.142512 4 0.605932 3.552970 0.096040 5 1.369440 1.744370 -0.286056 6 0.493842 1.324330 -0.047504 7 0.112090 2.228640 0.143544 8 -0.763505 1.808610 0.382097 Exact area is 6.000000 The computed area is 6.000004 TEST0782 For a polygon in 3D: POLYGON_AREA_3D_2 computes the area; The polygon vertices: Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 2.000000 1.000000 1.000000 3 1.000000 2.000000 1.000000 4 0.000000 1.000000 0.000000 Exact area is 2.449490 The computed area is 2.449490 The polygon vertices: Row: 1 2 3 Col 1 0.000000 0.000000 0.000000 2 2.626790 1.260090 -0.715657 3 1.481530 3.973000 -0.142512 4 0.605932 3.552970 0.096040 5 1.369440 1.744370 -0.286056 6 0.493842 1.324330 -0.047504 7 0.112090 2.228640 0.143544 8 -0.763505 1.808610 0.382097 Exact area is 6.000000 The computed area is 6.000004 TEST0784 For a polygon in 2D: POLYGON_CENTROID_2D computes the centroid. POLYGON_CENTROID_2D_2 computes the centroid. The polygon vertices: Row: 1 2 Col 1 1.000000 0.000000 2 2.000000 1.000000 3 1.000000 2.000000 4 0.000000 1.000000 POLYGON_CENTROID_2D: 1 1.000000 2 1.000000 POLYGON_CENTROID_2D_2: 1 1.000000 2 1.000000 TEST0786 For a polygon in 3D: POLYGON_CENTROID_3D computes the centroid. The polygon vertices: Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 2.000000 1.000000 1.000000 3 1.000000 2.000000 1.000000 4 0.000000 1.000000 0.000000 The centroid: 1 1.000000 2 1.000000 3 0.500000 TEST079 POLYGON_CONTAINS_POINT_2D determines if a point is in a polygon. POLYGON_CONTAINS_POINT_2D_2 determines if a point is in a polygon. The polygon vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 2.000000 1.000000 4 1.000000 2.000000 5 0.000000 2.000000 P In1 In2 1.000000 1.000000 1 1 3.000000 4.000000 0 0 0.000000 2.000000 1 1 0.500000 -0.250000 0 0 TEST080 For a polygon in 2D: POLYGON_DIAMETER_2D computes the diameter; The polygon vertices: Row: 1 2 Col 1 1.000000 0.000000 2 2.000000 1.000000 3 1.000000 2.000000 4 0.000000 1.000000 Diameter ( computed ) 2.000000 Diameter ( exact ) 2.000000 TEST0801 For a polygon in 2D: POLYGON_EXPAND_2D "expands" it by an amount H. The polygon vertices: Row: 1 2 Col 1 1.000000 1.000000 2 5.000000 1.000000 3 2.000000 4.000000 4 1.000000 3.000000 The expansion amount H = 0.500000 The expanded polygon: Row: 1 2 Col 1 0.500000 0.500000 2 6.207107 0.500000 3 2.000000 4.707107 4 0.500000 3.207107 TEST0803 For a REGULAR polygon in 2D: the inradius, outradius and side are related. POLYGON_INRAD_DATA_2D uses the inradius; POLYGON_OUTRAD_DATA_2D uses the inradius; POLYGON_SIDE_DATA_2D uses the inradius; Number of polygonal sides = 3 Assuming SIDE = 1.000000 AREA = 0.866025 RADIN = 0.288675 RADOUT = 0.577350 Assuming RADIN = 0.288675 AREA = 0.433013 RADOUT = 0.577350 SIDE = 1.000000 Assuming RADOUT = 0.577350 AREA = 0.433013 RADIN = 0.288675 SIDE = 1.000000 Number of polygonal sides = 4 Assuming SIDE = 1.000000 AREA = 2.000000 RADIN = 0.500000 RADOUT = 0.707107 Assuming RADIN = 0.500000 AREA = 1.000000 RADOUT = 0.707107 SIDE = 1.000000 Assuming RADOUT = 0.707107 AREA = 1.000000 RADIN = 0.500000 SIDE = 1.000000 Number of polygonal sides = 5 Assuming SIDE = 1.000000 AREA = 3.440955 RADIN = 0.688191 RADOUT = 0.850651 Assuming RADIN = 0.688191 AREA = 1.720477 RADOUT = 0.850651 SIDE = 1.000000 Assuming RADOUT = 0.850651 AREA = 1.720477 RADIN = 0.688191 SIDE = 1.000000 TEST0805 POLYGON_IS_CONVEX determines if a polygon is convex. Shape #1, a point: Row: 1 2 Col 1 0.000000 0.000000 The polygon is degenerate and convex. Shape #2, a line: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 2.000000 The polygon is degenerate and convex. Shape #3, a flat triangle: Row: 1 2 Col 1 0.000000 0.000000 2 2.000000 0.000000 3 1.000000 0.000000 The polygon is convex and clockwise. Shape #4, a CCW triangle: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.000000 2.000000 The polygon is convex and counterclockwise. Shape #5, a CW triangle: Row: 1 2 Col 1 0.000000 0.000000 2 0.000000 2.000000 3 1.000000 0.000000 The polygon is convex and clockwise. #6, Polygon with large angle: Row: 1 2 Col 1 1.000000 0.000000 2 2.000000 0.000000 3 3.000000 1.000000 4 0.000000 1.000000 The polygon is convex and counterclockwise. #7, Polygon with huge angle: Row: 1 2 Col 1 0.000000 0.000000 2 0.500000 0.500000 3 1.000000 0.000000 4 1.000000 1.000000 5 0.000000 1.000000 The polygon is not convex. #8, a star: Row: 1 2 Col 1 1.000000 0.000000 2 -0.809017 0.587785 3 0.309017 -0.951057 4 0.309017 0.951057 5 -0.809017 -0.587785 The polygon is not convex. #9, regular hexagon: Row: 1 2 Col 1 1.000000 0.000000 2 0.500000 0.866025 3 -0.500000 0.866025 4 -1.000000 0.000000 5 -0.500000 -0.866025 6 0.500000 -0.866025 The polygon is convex and counterclockwise. #10, double hexagon: Row: 1 2 Col 1 0.000000 0.000000 2 2.000000 0.000000 3 1.000000 1.000000 4 0.000000 0.000000 5 2.000000 0.000000 6 1.000000 1.000000 The polygon is not convex. #11, square knot: Row: 1 2 Col 1 1.000000 0.000000 2 3.000000 0.000000 3 3.000000 3.000000 4 0.000000 3.000000 5 0.000000 1.000000 6 2.000000 1.000000 7 2.000000 2.000000 8 1.000000 2.000000 The polygon is not convex. TEST0807 For a polygon in 3D: POLYGON_SOLID_ANGLE_3D computes the solid angle subtended by a planar polygon as viewed from a point P. TEST # 1 The viewing point P: 1 0.000000 2 0.000000 3 0.000000 The polygon vertices V: Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 0.000000 1.000000 0.000000 3 0.000000 0.000000 1.000000 Solid angle subtended: -1.570796 TEST # 2 The viewing point P: 1 0.000000 2 0.000000 3 0.000000 The polygon vertices V: Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 0.000000 0.000000 1.000000 3 0.000000 1.000000 0.000000 Solid angle subtended: 1.570796 TEST # 3 The viewing point P: 1 1.000000 2 2.000000 3 3.000000 The polygon vertices V: Row: 1 2 3 Col 1 2.000000 2.000000 3.000000 2 1.000000 3.000000 3.000000 3 1.000000 2.000000 4.000000 Solid angle subtended: -1.570796 TEST # 4 The viewing point P: 1 0.000000 2 0.000000 3 0.000000 The polygon vertices V: Row: 1 2 3 Col 1 2.000000 0.000000 0.000000 2 0.000000 2.000000 0.000000 3 0.000000 0.000000 2.000000 Solid angle subtended: -1.570796 TEST081 For a polyhedron in 3D: POLYHEDRON_AREA_3D computes surface area; Number of faces is 4 Order of each face: 1 3 2 3 3 3 4 3 Nodes per face: 1 3 2 1 2 1 2 4 3 1 4 3 4 2 3 4 Polyhedron nodes 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 Surface area = 2.366025 Exact area = 2.366025 TEST082 For a polyhedron in 3D: POLYHEDRON_CENTROID_3D computes the centroid; Number of faces is 4 Order of each face: 1 3 2 3 3 3 4 3 Nodes per face: 1 3 2 1 2 1 2 4 3 1 4 3 4 2 3 4 Polyhedron nodes: 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 Computed centroid: 1 0.250000 2 0.250000 3 0.250000 Exact centroid: 1 0.250000 2 0.250000 3 0.250000 TEST0825 POLYHEDRON_CONTAINS_POINT_3D determines if a point is inside a polyhedron. We test this routine by using a tetrahedron as the polyhedron. For this shape, an independent check can be made, using barycentric coordinates. We label these checks IN1 and IN2, and we expect them to agree. The vertices: 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 The face orders: 1 3 2 3 3 3 4 3 The nodes making each face: Row: 1 2 3 Col 1 1 2 4 2 1 3 2 3 1 4 3 4 2 3 4 X Y Z IN1 IN2 0.218418 0.956318 0.829509 0 0 0.561695 0.415307 0.066119 0 0 0.257578 0.109957 0.043829 1 1 0.633966 0.061727 0.449539 0 0 0.401306 0.754673 0.797287 0 0 0.001838 0.897504 0.350752 0 0 0.094545 0.013617 0.859097 1 1 0.840847 0.123104 0.007512 1 1 0.260303 0.912484 0.113664 0 0 0.351629 0.822887 0.267132 0 0 0.692066 0.561662 0.861216 0 0 0.453794 0.911977 0.597917 0 0 0.188955 0.761492 0.396988 0 0 0.185314 0.574366 0.367027 0 0 0.617205 0.361529 0.212930 0 0 0.714471 0.117707 0.299329 0 0 0.825003 0.824660 0.061862 0 0 0.710781 0.088283 0.777994 0 0 0.745303 0.308675 0.899373 0 0 0.763537 0.761731 0.406970 0 0 0.938749 0.562088 0.017820 0 0 0.501103 0.041909 0.368851 1 1 0.271724 0.858573 0.029037 0 0 0.017442 0.152384 0.114319 1 1 0.353907 0.119308 0.206653 1 1 0.212924 0.612948 0.809519 0 0 0.587090 0.215492 0.768056 0 0 0.723297 0.448019 0.855176 0 0 0.945017 0.909057 0.519726 0 0 0.030195 0.481067 0.292313 1 1 0.902640 0.667842 0.412278 0 0 0.156948 0.833282 0.964404 0 0 0.740790 0.456099 0.653561 0 0 0.406827 0.540539 0.832281 0 0 0.145756 0.717128 0.775651 0 0 0.362262 0.531111 0.379977 0 0 0.269285 0.877418 0.761285 0 0 0.913675 0.135794 0.291195 0 0 0.118211 0.771781 0.320633 0 0 0.877413 0.679476 0.949176 0 0 0.793361 0.021366 0.102278 1 1 0.991406 0.563260 0.704528 0 0 0.994146 0.604334 0.046145 0 0 0.562029 0.021515 0.609135 0 0 0.728789 0.748407 0.469634 0 0 0.135194 0.202348 0.860120 0 0 0.040624 0.773973 0.155941 1 1 0.895727 0.487127 0.148682 0 0 0.893345 0.445207 0.599347 0 0 0.228689 0.572300 0.639618 0 0 0.065985 0.002120 0.629405 1 1 0.412842 0.628397 0.469879 0 0 0.258509 0.754493 0.768513 0 0 0.403978 0.660236 0.584298 0 0 0.304735 0.684345 0.780800 0 0 0.910878 0.131231 0.595555 0 0 0.490323 0.854159 0.848580 0 0 0.083143 0.383972 0.411112 1 1 0.565026 0.394392 0.538036 0 0 0.775243 0.509806 0.305324 0 0 0.584076 0.559778 0.195029 0 0 0.856103 0.529502 0.344293 0 0 0.530101 0.406241 0.692814 0 0 0.121905 0.858971 0.722382 0 0 0.079996 0.492085 0.466644 0 0 0.878359 0.584231 0.173778 0 0 0.684731 0.278111 0.214915 0 0 0.068821 0.679375 0.261012 0 0 0.829383 0.442158 0.351522 0 0 0.032762 0.628850 0.086721 1 1 0.516988 0.011003 0.919105 0 0 0.396910 0.871228 0.722048 0 0 0.455404 0.966804 0.078531 0 0 0.870750 0.688186 0.337421 0 0 0.036307 0.214310 0.908339 0 0 0.455910 0.474342 0.258065 0 0 0.302162 0.434341 0.971341 0 0 0.335417 0.358697 0.615840 0 0 0.424428 0.366481 0.438869 0 0 0.078173 0.849352 0.065509 1 1 0.003868 0.008359 0.486560 1 1 0.622276 0.598399 0.290530 0 0 0.944417 0.824733 0.290477 0 0 0.038914 0.034183 0.510304 1 1 0.677301 0.397581 0.151405 0 0 0.662250 0.428705 0.236546 0 0 0.628882 0.621841 0.281714 0 0 0.769302 0.663225 0.824001 0 0 0.986634 0.350637 0.151555 0 0 0.179257 0.770598 0.441796 0 0 0.263209 0.761996 0.869792 0 0 0.600145 0.629358 0.623897 0 0 0.830126 0.919770 0.573310 0 0 0.620359 0.368776 0.024396 0 0 0.023587 0.430812 0.652667 0 0 0.373921 0.493998 0.618198 0 0 0.055057 0.341973 0.532633 1 1 0.969348 0.825221 0.485053 0 0 0.285376 0.319971 0.754984 0 0 0.014932 0.956749 0.075678 0 0 TEST083 For a polyhedron in 3D: POLYHEDRON_VOLUME_3D computes volume. POLYHEDRON_VOLUME_3D_2 computes volume. Number of faces is 4 Order of each face: 1 3 2 3 3 3 4 3 Nodes per face: 1 3 2 1 2 1 2 4 3 1 4 3 4 2 3 4 Polyhedron nodes 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 Volume ( method 1 ) = 0.166667 Volume ( method 2 ) = 0.166667 Volume ( exact ) = 0.166667 TEST084 POLYLINE_INDEX_POINT_ND finds a point on a polyline with given arclength. POLYLINE_ARCLENGTH_ND computes the arclength of the polyline, and its nodes. The line we examine is defined by these points: P Arclength(X,Y) 0.000000 0.000000 0.000000 1.000000 1.000000 1.414214 2.000000 0.000000 2.828427 0.000000 0.000000 4.828427 We search for the point with coordinate 2.000000 The computed point: 1 1.414214 2 0.585786 TEST0844 POLYLINE_POINTS_ND computes points on a polyline. The defining points: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 4 1.000000 2.000000 The computed points: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.666667 3 0.000000 0.333333 4 0.000000 0.000000 5 0.333333 0.000000 6 0.666667 0.000000 7 1.000000 0.000000 8 1.000000 0.333333 9 1.000000 0.666667 10 1.000000 1.000000 11 1.000000 1.333333 12 1.000000 1.666667 13 1.000000 2.000000 TEST0845 POLYLOOP_ARCLENGTH_ND computes the arclength of the nodes of a polyloop. P Arclength(P) 0.000000 0.000000 0.000000 1.000000 1.000000 1.414214 2.000000 0.000000 2.828427 0.000000 0.000000 4.828427 0.000000 0.000000 4.828427 TEST0846 POLYLOOP_POINTS_ND computes points on a polyloop. The defining points: Row: 1 2 Col 1 0.000000 2.000000 2 0.000000 0.000000 3 1.000000 0.000000 4 1.000000 2.000000 The computed points: Row: 1 2 Col 1 0.000000 2.000000 2 0.000000 1.454545 3 0.000000 0.909091 4 0.000000 0.363636 5 0.181818 0.000000 6 0.727273 0.000000 7 1.000000 0.272727 8 1.000000 0.818182 9 1.000000 1.363636 10 1.000000 1.909091 11 0.545455 2.000000 12 0.000000 2.000000 TEST085 PLANE_EXP_PRO3 projects an object point orthographically into a plane. PO PP 0.000000 2.000000 2.000000 -1.000000 1.000000 1.000000 4.000000 5.000000 -8.000000 4.000000 5.000000 -8.000000 0.250000 0.250000 0.250000 0.333333 0.333333 0.333333 5.000000 -2.000000 -3.000000 5.333333 -1.666667 -2.666667 -2.000000 0.000000 0.000000 -1.000000 1.000000 1.000000 TEST170 PROVEC projects a vector onto a subspace. Base vectors Row: 1 2 3 4 Col 1 4.000000 3.000000 2.000000 1.000000 2 1.000000 2.000000 3.000000 4.000000 Vector to be projected: 1 1.000000 2 1.000000 3 1.000000 4 2.000000 Projected vector in BASE coordinates: 1 2.008316 2 1.632993 Projected vector in original coordinates: 1 0.800000 2 1.100000 3 1.400000 4 1.700000 TEST171 For a quadrilateral in 2D: QUAD_AREA_2D finds the area; QUAD_AREA2_2D finds the area; The vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 1.000000 1.000000 4 0.000000 1.000000 QUAD_AREA_2D area is 1.000000 QUAD_AREA2_2D area is 1.000000 TEST1712 For a quadrilateral in 3D: QUAD_AREA_3D finds the area. The vertices: Row: 1 2 3 Col 1 2.000000 2.000000 0.000000 2 0.000000 0.000000 0.000000 3 1.000000 1.000000 1.000000 4 3.000000 3.000000 1.000000 QUAD_AREA_3D area is 2.828427 Sum of TRIANGLE_AREA_3D: 2.828427 TEST1715 For a quadrilateral in 2D: QUAD_AREA_2D finds the area; QUAD_CONTAINS_POINT_2D tells if a point is inside; QUAD_POINT_DIST_2D computes the distance. QUAD_POINT_DIST_SIGNED_2D computes signed distance. The vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 1.000000 1.000000 4 0.000000 1.000000 P Contains Dist Dist Signed Unsigned 0.250000 0.250000 1 -0.250000 0.250000 0.750000 0.250000 1 -0.250000 0.250000 1.000000 1.000000 1 0.000000 0.000000 11.000000 0.500000 0 10.000000 10.000000 0.000000 0.500000 1 0.000000 0.000000 0.500000 -10.000000 0 10.000000 10.000000 2.000000 2.000000 0 1.000000 1.414214 TEST172 QUAT_CONJ conjugates a quaternion; QUAT_INV inverts a quaternion; QUAT_MUL multiplies quaternions. QUAT_NORM computes the norm. Q1 = 2.000000 3.000000 4.000000 5.000000 Norm ( Q1 ) = 7.348469 Q2 = conj(Q1) = 2.000000 -3.000000 -4.000000 -5.000000 Q3 = Q1*Q2 = 54.000000 0.000000 0.000000 0.000000 Q2 = inv(Q1) = 0.037037 -0.055556 -0.074074 -0.092593 Q3 = Q1*Q2 = 1.000000 0.000000 0.000000 0.000000 TEST173 RADEC_DISTANCE_3D computes the angular separation between two points on a sphere described in terms of right ascension and declination. RA1 DEC1 RA2 DEC2 Radians Degrees 0.000000 0.000000 6.000000 0.000000 1.570796 90.000000 0.000000 0.000000 0.000000 90.000000 1.570796 90.000000 0.000000 0.000000 3.000000 35.264390 0.955317 54.735610 0.000000 0.000000 22.546573 -10.519735 0.420534 24.094843 0.000000 0.000000 15.000000 -35.264390 2.186276 125.264390 6.000000 0.000000 0.000000 90.000000 1.570796 90.000000 6.000000 0.000000 3.000000 35.264390 0.955317 54.735610 6.000000 0.000000 22.546573 -10.519735 1.944589 111.416714 6.000000 0.000000 15.000000 -35.264390 2.186276 125.264390 0.000000 90.000000 3.000000 35.264390 0.955317 54.735610 0.000000 90.000000 22.546573 -10.519735 1.754400 100.519735 0.000000 90.000000 15.000000 -35.264390 2.186276 125.264390 3.000000 35.264390 22.546573 -10.519735 1.358384 77.829677 3.000000 35.264390 15.000000 -35.264390 3.141593 180.000000 22.546573 -10.519735 15.000000 -35.264390 1.783209 102.170323 TEST174 RADEC_TO_XYZ converts XYZ to RADEC coordinates. XYZ_TO_RADEC converts RADEC to XYZ coordinates. P1 RA DEC P2 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 6.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 90.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 3.000000 35.264390 0.577350 0.577350 0.577350 5.000000 -2.000000 -1.000000 22.546573 -10.519735 0.912871 -0.365148 -0.182574 -2.000000 -2.000000 -2.000000 15.000000 -35.264390 -0.577350 -0.577350 -0.577350 TEST1745 R8MAT_SOLVE solves linear systems. The linear system: Col: 1 2 3 4 5 Row 1 1 2 3 14 7 2 4 5 6 32 16 3 7 8 0 23 7 The computed solutions: 1.000000 1.000000 2.000000 0.000000 3.000000 2.000000 TEST1746 R8MAT_INVERSE_3D inverts a 3 by 3 matrix. Matrix A: Col: 1 2 3 Row 1 3 2 1 2 2 2 1 3 0 1 1 Determinant of A is 1.000000 Inverse matrix B: Col: 1 2 3 Row 1 1 -1 0 2 -2 3 -1 3 2 -3 2 TEST175 ROTATION_AXIS_VECTOR_3D applies an axis rotation to a vector; ROTATION_MAT_VECTOR_3D applies a matrix rotation to a vector. ROTATION_QUAT_VECTOR_3D applies a quaternion rotation to a vector. The vector: 1 1.000000 2 4.000000 3 10.000000 The rotation axis: 1 0.236174 2 -0.881412 3 -0.409065 The rotation angle is 1.159804 The rotated vector: 1 -7.227240 2 2.964102 3 7.482052 The rotation matrix: Col: 1 2 3 Row 1 0.433013 0.25 -0.866025 2 -0.5 0.866025 -1.04741e-08 3 0.75 0.433013 0.5 The rotated vector: 1 -7.227240 2 2.964102 3 7.482052 The rotation quaternion: 1 0.836516 2 0.129409 3 -0.482963 4 -0.224144 The rotated vector: 1 -7.227240 2 2.964102 3 7.482052 The vector: 1 1.000000 2 1.000000 3 1.000000 The rotation axis: 1 0.000000 2 0.000000 3 2.000000 The rotation angle is 1.570796 The rotated vector: 1 -1.000000 2 1.000000 3 1.000000 TEST176 ROTATION_MAT2AXIS_3D computes a rotation axis and angle from a rotation matrix. ROTATION_AXIS2MAT_3D computes a rotation matrix from a rotation axis and angle. The rotation matrix: Col: 1 2 3 Row 1 0.433013 0.25 -0.866025 2 -0.5 0.866025 0 3 0.75 0.433013 0.5 The rotation axis: 1 0.236174 2 -0.881412 3 -0.409065 The rotation angle is 1.159804 The rotation matrix: Col: 1 2 3 Row 1 0.433013 0.25 -0.866025 2 -0.5 0.866025 9.17325e-09 3 0.75 0.433013 0.5 TEST177 ROTATION_QUAT2AXIS_3D computes a rotation axis and angle from a rotation quaternion. ROTATION_AXIS2QUAT_3D computes a rotation quaternion from a rotation axis and angle. Rotation axis: 1 0.236174 2 -0.881412 3 -0.409065 Rotation angle is 1.159804 The rotation quaternion: 1 0.836516 2 0.129409 3 -0.482963 4 -0.224144 The rotation axis: 1 0.236174 2 -0.881412 3 -0.409065 The rotation angle is 1.159804 TEST178 ROTATION_MAT2QUAT_3D computes a rotation quaternion from a rotation matrix. ROTATION_QUAT2MAT_3D computes a rotation matrix from a rotation quaternion. The rotation matrix: Col: 1 2 3 Row 1 0.433013 0.25 -0.866025 2 -0.5 0.866025 0 3 0.75 0.433013 0.5 The rotation quaternion: 1 0.836516 2 0.129410 3 -0.482963 4 -0.224144 The rotation matrix: Col: 1 2 3 Row 1 0.433013 0.25 -0.866025 2 -0.5 0.866025 9.17325e-09 3 0.75 0.433013 0.5 TEST1787 DGE_FA factors a general linear system, DGE_SL solves a factored system. Matrix order N = 5 Matrix A. Col: 1 2 3 4 5 Row 1 0.218418 0.0661187 0.0617272 0.00183837 0.859097 2 0.956318 0.257578 0.449539 0.897504 0.840847 3 0.829509 0.109957 0.401306 0.350752 0.123104 4 0.561695 0.043829 0.754673 0.0945448 0.00751236 5 0.415307 0.633966 0.797287 0.0136169 0.260303 Factored ALU matrix. Col: 1 2 3 4 5 Row 1 0.956318 0.257578 0.449539 0.897504 0.840847 2 -0.228395 0.522106 0.602062 -0.376149 -0.104858 3 -0.867399 0.217324 0.614552 -0.510026 -0.507943 4 -0.587352 0.20582 -0.231419 -0.391459 -0.511487 5 -0.434277 -0.0139612 0.0803036 -0.610161 0.939815 Solution: (Should be 1, 2, 3,...) 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 Solution: (Should be 1, 1, 1,...) 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 Solution of transposed system: (Should be 1, 2, 3,...) 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 TEST1893 RTP_TO_XYZ converts XYZ to (R,Theta,Phi) coordinates. XYZ_TO_RTP converts (R,Theta,Phi) to XYZ coordinates. X1 Y1 Z1 R THETA PHI X2 Y2 Z2 -0.907909 2.781588 2.147546 3.629529 1.886293 0.937646 -0.907909 2.781588 2.147546 0.808477 0.076535 -1.669406 1.856451 0.094385 2.688839 0.808477 0.076535 -1.669406 -0.712111 -1.450216 -1.780855 2.404511 4.255937 2.404805 -0.712111 -1.450216 -1.780855 1.169829 -1.691364 0.247695 2.071367 5.317488 1.450929 1.169829 -1.691364 0.247695 0.006531 1.773367 1.986435 2.662855 1.567113 0.728792 0.006531 1.773367 1.986435 TEST036 SEGMENT_CONTAINS_POINT_1D determines if a point lies within a line segment in 1D. P1 P T 2.000000 6.000000 3.000000 0.250000 10.000000 -10.000000 7.500000 0.125000 8.000000 10.000000 20.000000 6.000000 88.000000 88.000000 5.000000 -Inf TEST0365 SEGMENT_POINT_DIST_2D computes the distance between a line segment and point in 2D. TEST = 1 P1 = 0.218418 0.956318 P2 = 0.829509 0.561695 P = 0.415307 0.066119 DIST = 0.641015 TEST = 2 P1 = 0.257578 0.109957 P2 = 0.043829 0.633966 P = 0.061727 0.449539 DIST = 0.053085 TEST = 3 P1 = 0.401306 0.754673 P2 = 0.797287 0.001838 P = 0.897504 0.350752 DIST = 0.251122 TEST0366 SEGMENT_POINT_DIST_3D computes the distance between a line segment and point in 3D. TEST = 1 P1 = 0.218418 0.956318 0.829509 P2 = 0.561695 0.415307 0.066119 P = 0.257578 0.109957 0.043829 DIST = 0.431536 TEST = 2 P1 = 0.633966 0.061727 0.449539 P2 = 0.401306 0.754673 0.797287 P = 0.001838 0.897504 0.350752 DIST = 0.615929 TEST = 3 P1 = 0.094545 0.013617 0.859097 P2 = 0.840847 0.123104 0.007512 P = 0.260303 0.912484 0.113664 DIST = 0.907579 TEST0367 SEGMENT_POINT_NEAR_2D computes the nearest point from a line segment to a point in 2D. TEST = 1 P1 = 0.218418 0.956318 P2 = 0.829509 0.561695 P = 0.415307 0.066119 PN = 0.763049 0.604613 DIST = 0.641015 T = 0.891243 TEST = 2 P1 = 0.257578 0.109957 P2 = 0.043829 0.633966 P = 0.061727 0.449539 PN = 0.110880 0.469589 DIST = 0.053085 T = 0.686309 TEST = 3 P1 = 0.401306 0.754673 P2 = 0.797287 0.001838 P = 0.897504 0.350752 PN = 0.675252 0.233851 DIST = 0.251122 T = 0.691815 TEST0368 SEGMENT_POINT_NEAR_3D computes the nearest point from a line segment to a point in 3D. TEST = 1 P1 = 0.218418 0.956318 0.829509 P2 = 0.561695 0.415307 0.066119 P = 0.257578 0.109957 0.043829 PN = 0.561695 0.415307 0.066119 DIST = 0.431536 T = 1.000000 TEST = 2 P1 = 0.633966 0.061727 0.449539 P2 = 0.401306 0.754673 0.797287 P = 0.001838 0.897504 0.350752 PN = 0.401306 0.754673 0.797287 DIST = 0.615929 T = 1.000000 TEST = 3 P1 = 0.094545 0.013617 0.859097 P2 = 0.840847 0.123104 0.007512 P = 0.260303 0.912484 0.113664 PN = 0.588707 0.086113 0.295222 DIST = 0.907579 T = 0.662148 TEST037 SEGMENT_POINT_NEAR_3D computes the nearest point on a line segment, to a given point, in 3D. Case, T, Distance, PN. 1 1.000000 5.000000 8.000000 6.000000 0.000000 2 0.333333 1.000000 4.000000 4.000000 0.000000 3 0.666667 0.000000 6.000000 5.000000 0.000000 TEST1788 SIMPLEX_LATTICE_LAYER_POINT_NEXT returns the next point in an N-dimensional simplex lattice layer defined by: C(N+1) - 1 <= X(1)/C(1) + X(2)/C(2) + ... + X(N)/C(N) <= C(N+1). N = 1 C = 2 Layer 0 1 0 No more. Layer 1 1 1 2 2 No more. Layer 2 1 3 2 4 No more. N = 2 C = 2 3 Layer 0 1 0 0 No more. Layer 1 1 1 0 2 2 0 3 0 1 4 1 1 5 0 2 6 0 3 No more. Layer 2 1 3 0 2 4 0 3 2 1 4 3 1 5 1 2 6 2 2 7 1 3 8 2 3 9 0 4 10 1 4 11 0 5 12 0 6 No more. 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. N = 4 C = 2 3 4 5 Layer 0 1 0 0 0 0 No more. Layer 1 1 1 0 0 0 2 2 0 0 0 3 0 1 0 0 4 1 1 0 0 5 0 2 0 0 6 0 3 0 0 7 0 0 1 0 8 1 0 1 0 9 0 1 1 0 10 0 2 1 0 11 0 0 2 0 12 1 0 2 0 13 0 1 2 0 14 0 0 3 0 15 0 0 4 0 16 0 0 0 1 17 1 0 0 1 18 0 1 0 1 19 0 2 0 1 20 0 0 1 1 21 1 0 1 1 22 0 1 1 1 23 0 0 2 1 24 0 0 3 1 25 0 0 0 2 26 1 0 0 2 27 0 1 0 2 28 0 0 1 2 29 0 1 1 2 30 0 0 2 2 31 0 0 0 3 32 0 1 0 3 33 0 0 1 3 34 0 0 0 4 35 0 0 0 5 No more. Layer 2 1 3 0 0 0 2 4 0 0 0 3 2 1 0 0 4 3 1 0 0 5 1 2 0 0 6 2 2 0 0 7 1 3 0 0 8 2 3 0 0 9 0 4 0 0 10 1 4 0 0 11 0 5 0 0 12 0 6 0 0 13 2 0 1 0 14 3 0 1 0 15 1 1 1 0 16 2 1 1 0 17 1 2 1 0 18 2 2 1 0 19 0 3 1 0 20 1 3 1 0 21 0 4 1 0 22 0 5 1 0 23 2 0 2 0 24 3 0 2 0 25 1 1 2 0 26 2 1 2 0 27 0 2 2 0 28 1 2 2 0 29 0 3 2 0 30 1 3 2 0 31 0 4 2 0 32 1 0 3 0 33 2 0 3 0 34 0 1 3 0 35 1 1 3 0 36 0 2 3 0 37 1 2 3 0 38 0 3 3 0 39 1 0 4 0 40 2 0 4 0 41 0 1 4 0 42 1 1 4 0 43 0 2 4 0 44 0 3 4 0 45 0 0 5 0 46 1 0 5 0 47 0 1 5 0 48 0 2 5 0 49 0 0 6 0 50 1 0 6 0 51 0 1 6 0 52 0 0 7 0 53 0 0 8 0 54 2 0 0 1 55 3 0 0 1 56 1 1 0 1 57 2 1 0 1 58 1 2 0 1 59 2 2 0 1 60 0 3 0 1 61 1 3 0 1 62 0 4 0 1 63 0 5 0 1 64 2 0 1 1 65 3 0 1 1 66 1 1 1 1 67 2 1 1 1 68 0 2 1 1 69 1 2 1 1 70 0 3 1 1 71 1 3 1 1 72 0 4 1 1 73 1 0 2 1 74 2 0 2 1 75 0 1 2 1 76 1 1 2 1 77 0 2 2 1 78 1 2 2 1 79 0 3 2 1 80 1 0 3 1 81 2 0 3 1 82 0 1 3 1 83 1 1 3 1 84 0 2 3 1 85 0 3 3 1 86 0 0 4 1 87 1 0 4 1 88 0 1 4 1 89 0 2 4 1 90 0 0 5 1 91 1 0 5 1 92 0 1 5 1 93 0 0 6 1 94 0 0 7 1 95 2 0 0 2 96 3 0 0 2 97 1 1 0 2 98 2 1 0 2 99 0 2 0 2 100 1 2 0 2 101 0 3 0 2 102 1 3 0 2 103 0 4 0 2 104 1 0 1 2 105 2 0 1 2 106 1 1 1 2 107 2 1 1 2 108 0 2 1 2 109 1 2 1 2 110 0 3 1 2 111 0 4 1 2 112 1 0 2 2 113 2 0 2 2 114 0 1 2 2 115 1 1 2 2 116 0 2 2 2 117 0 3 2 2 118 0 0 3 2 119 1 0 3 2 120 0 1 3 2 121 1 1 3 2 122 0 2 3 2 123 0 0 4 2 124 1 0 4 2 125 0 1 4 2 126 0 0 5 2 127 0 1 5 2 128 0 0 6 2 129 1 0 0 3 130 2 0 0 3 131 1 1 0 3 132 2 1 0 3 133 0 2 0 3 134 1 2 0 3 135 0 3 0 3 136 0 4 0 3 137 1 0 1 3 138 2 0 1 3 139 0 1 1 3 140 1 1 1 3 141 0 2 1 3 142 0 3 1 3 143 0 0 2 3 144 1 0 2 3 145 0 1 2 3 146 1 1 2 3 147 0 2 2 3 148 0 0 3 3 149 1 0 3 3 150 0 1 3 3 151 0 0 4 3 152 0 1 4 3 153 0 0 5 3 154 1 0 0 4 155 2 0 0 4 156 0 1 0 4 157 1 1 0 4 158 0 2 0 4 159 1 2 0 4 160 0 3 0 4 161 0 0 1 4 162 1 0 1 4 163 0 1 1 4 164 1 1 1 4 165 0 2 1 4 166 0 0 2 4 167 1 0 2 4 168 0 1 2 4 169 0 2 2 4 170 0 0 3 4 171 0 1 3 4 172 0 0 4 4 173 1 0 0 5 174 2 0 0 5 175 0 1 0 5 176 1 1 0 5 177 0 2 0 5 178 0 3 0 5 179 0 0 1 5 180 1 0 1 5 181 0 1 1 5 182 0 2 1 5 183 0 0 2 5 184 1 0 2 5 185 0 1 2 5 186 0 0 3 5 187 0 0 4 5 188 0 0 0 6 189 1 0 0 6 190 0 1 0 6 191 0 2 0 6 192 0 0 1 6 193 1 0 1 6 194 0 1 1 6 195 0 0 2 6 196 0 0 3 6 197 0 0 0 7 198 1 0 0 7 199 0 1 0 7 200 0 0 1 7 201 0 1 1 7 202 0 0 2 7 203 0 0 0 8 204 0 1 0 8 205 0 0 1 8 206 0 0 0 9 207 0 0 0 10 No more. TEST1789 SIMPLEX_LATTICE_POINT_NEXT returns the next lattice point in an N-dimensional simplex defined by: 0 <= X(1)/C(1) + X(2)/C(2) + ... + X(N)/C(N) <= C(N+1). N = 1 C = 2 1 1 0 2 1 3 2 No more. N = 2 C = 3 2 1 1 0 0 2 1 0 3 2 0 4 3 0 5 0 1 6 1 1 7 0 2 No more. 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. N = 4 C = 5 4 3 2 1 1 0 0 0 0 2 1 0 0 0 3 2 0 0 0 4 3 0 0 0 5 0 1 0 0 6 1 1 0 0 7 0 2 0 0 8 0 0 1 0 9 1 0 1 0 No more. TEST179 For the truncated icosahedron, or soccer ball, SOCCER_SIZE_3D returns dimension information; SOCCER_SHAPE_3D returns face and order information. We will use this information to compute the areas and centers of each face. Number of points = 60 Number of edges = 90 Number of faces = 32 Maximum face order = 6 Face Order Area 1 6 0.441056 2 6 0.441056 3 5 0.292073 4 6 0.441057 5 5 0.292073 6 6 0.441056 7 5 0.292073 8 6 0.441056 9 6 0.441056 10 6 0.441056 11 5 0.292073 12 6 0.441056 13 5 0.292072 14 6 0.441056 15 5 0.292073 16 6 0.441056 17 6 0.441056 18 6 0.441056 19 5 0.292072 20 6 0.441056 21 5 0.292073 22 5 0.292073 23 6 0.441056 24 6 0.441056 25 6 0.441056 26 5 0.292073 27 6 0.441056 28 5 0.292073 29 6 0.441057 30 6 0.441056 31 5 0.292073 32 6 0.441056 Face Center 1 0.176084 0.333333 0.854729 2 -0.374587 -0.042441 0.854729 3 0.185551 -0.271913 0.900685 4 0.681916 -0.042441 0.637077 5 -0.371103 0.543825 0.697234 6 -0.209088 -0.650456 0.637077 7 0.616466 0.543825 0.493784 8 0.443866 -0.650456 0.502561 9 -0.804597 0.222222 0.419426 10 0.086406 0.830237 0.419426 11 -0.731143 -0.375774 0.493784 12 0.904859 0.222222 0.067258 13 0.866776 -0.375774 0.164595 14 -0.519688 0.761567 0.150394 15 0.033908 -0.944118 0.164595 16 -0.536815 -0.761567 0.067258 17 0.536815 0.761567 -0.067258 18 0.519688 -0.761567 -0.150394 19 -0.866776 0.375774 -0.164595 20 -0.904859 -0.222222 -0.067258 21 -0.033908 0.944118 -0.164595 22 0.731143 0.375774 -0.493784 23 0.804597 -0.222222 -0.419426 24 -0.443867 0.650456 -0.502561 25 -0.086406 -0.830237 -0.419426 26 -0.616466 -0.543825 -0.493784 27 0.209088 0.650456 -0.637077 28 0.371103 -0.543825 -0.697234 29 -0.681916 0.042441 -0.637077 30 0.374587 0.042441 -0.854729 31 -0.185551 0.271913 -0.900685 32 -0.176084 -0.333333 -0.854729 TEST180 SORT_HEAP_EXTERNAL sorts objects externally. Unsorted array: 1 5 2 20 3 17 4 12 5 9 6 2 7 6 8 3 9 1 10 13 11 2 12 9 13 9 14 16 15 16 16 1 17 18 18 8 19 2 20 1 Sorted array: 1 1 2 1 3 1 4 2 5 2 6 2 7 3 8 5 9 6 10 8 11 9 12 9 13 9 14 12 15 13 16 16 17 16 18 17 19 18 20 20 TEST1805 For an N-dimensional simplex, SIMPLEX_VOLUME_ND computes the volume. Here, we check the routine by comparing it with TETRAHEDRON_VOLUME_3D. Simplex 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 Volume computed by TETRAHEDRON_VOLUME_3D: 0.638429 Volume computed by SIMPLEX_VOLUME_ND: 0.638429 TEST181 SPHERE_DIA2IMP_3D converts a sphere from diameter to implicit form. Point P1: 1 -1.000000 2 -1.000000 3 4.000000 Point P2: 1 5.000000 2 7.000000 3 4.000000 Radius: 5.000000 The center: 1 2.000000 2 3.000000 3 4.000000 TEST182 SPHERE_EXP_CONTAINS_POINT_3D determines if a point is within an explicit sphere; SPHERE_IMP_CONTAINS_POINT_3D determines if a point is within an implicit sphere; SPHERE_EXP_CONTAINS_POINT_3D: Inside, P 1 1.000000 2.000000 3.000000 0 7.000000 2.000000 3.000000 1 1.000000 5.000000 3.000000 1 2.500000 3.500000 4.500000 SPHERE_IMP_CONTAINS_POINT_3D: Inside, P 1 1.000000 2.000000 3.000000 0 7.000000 2.000000 3.000000 1 1.000000 5.000000 3.000000 1 2.500000 3.500000 4.500000 TEST183 SPHERE_EXP_POINT_NEAR_3D determines if a point is within an explicit sphere; SPHERE_IMP_POINT_NEAR_3D determines if a point is within an implicit sphere; Sphere radius 3.000000 Sphere center: 1 1.000000 2 2.000000 3 3.000000 SPHERE_EXP_POINT_NEAR_3D: P, PN 1.000000 2.000000 3.000000 2.732051 3.732051 4.732051 7.000000 2.000000 3.000000 4.000000 2.000000 3.000000 1.000000 5.000000 3.000000 1.000000 5.000000 3.000000 2.500000 3.500000 4.500000 2.732051 3.732051 4.732051 SPHERE_IMP_POINT_NEAR_3D: P, PN 1.000000 2.000000 3.000000 2.732051 3.732051 4.732051 7.000000 2.000000 3.000000 4.000000 2.000000 3.000000 1.000000 5.000000 3.000000 1.000000 5.000000 3.000000 2.500000 3.500000 4.500000 2.732051 3.732051 4.732051 TEST1835 SPHERE_EXP2IMP_3D: explicit sphere => implicit form; SPHERE_IMP2EXP_3D: implicit sphere => explicit form. Initial form of explicit sphere: 4.000000 2.000000 3.000000 1.000000 5.000000 3.000000 1.000000 2.000000 6.000000 -2.000000 2.000000 3.000000 Computed form of implicit sphere: Imputed radius = 3.000000 Imputed center 1 1.000000 2 2.000000 3 3.000000 Computed form of explicit sphere: 1.000000 2.000000 6.000000 3.598076 2.000000 1.500000 -0.299038 4.250000 1.500000 -0.299038 -0.250000 1.500000 TEST187 SPHERE_IMP_GRIDFACES_3D computes gridfaces on a sphere in 3D. Number of intermediate 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 TEST188 SPHERE_IMP_POINT_PROJECT_3D projects a 3D point onto a sphere. P1 projection P2 2.000000 0.000000 0.000000 2.000000 2.000000 0.000000 0.000000 4.000000 0.000000 0.000000 4.000000 0.000000 2.000000 4.000000 10.000000 2.000000 4.000000 2.000000 3.000000 5.000000 0.000000 3.414214 5.414214 0.000000 TEST189 For a implicit sphere in N dimensions: SPHERE_IMP_AREA_ND computes the area; SPHERE_IMP_VOLUME_ND computes the volume. We use a radius of R = 1.000000 DIM_NUM Area Volume 2 6.283185 3.141593 3 12.566371 4.188790 4 19.739209 4.934802 5 26.318945 5.263789 6 31.006277 5.167713 7 33.073362 4.724766 8 32.469697 4.058712 9 29.686580 3.298509 10 25.501640 2.550164 TEST1895: SPHERE_UNIT_AREA_ND evaluates the area of the unit sphere in N dimensions. SPHERE_UNIT_AREA_VALUES returns some test values. DIM_NUM Exact Computed Area Area 1 2.000000 2.000000 2 6.283185 6.283185 3 12.566371 12.566371 4 19.739209 19.739209 5 26.318945 26.318945 6 31.006277 31.006277 7 33.073362 33.073362 8 32.469697 32.469697 9 29.686580 29.686580 10 25.501640 25.501640 11 20.725143 20.725143 12 16.023153 16.023153 13 11.838174 11.838174 14 8.389703 8.389703 15 5.721649 5.721649 16 3.765290 3.765290 17 2.396679 2.396679 18 1.478626 1.478626 19 0.885810 0.885810 20 0.516138 0.516138 TEST190 For the unit sphere in 2 dimensions (the circle): SPHERE_UNIT_SAMPLE_2D samples; A few sample values: 0.197134 0.980377 0.962570 -0.271032 0.479049 -0.877788 -0.925802 -0.378008 -0.861723 0.507380 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N_SAMPLE increases. Average: -0.019487 -0.015738 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. We expect a value near 2 / PI = 0.6366... V: 0.805634 -0.592413 Average |(XdotV)| 0.649573 V: 0.918517 -0.395381 Average |(XdotV)| 0.623194 V: -0.630859 -0.775898 Average |(XdotV)| 0.648768 V: 0.572459 -0.819933 Average |(XdotV)| 0.638814 V: -0.980377 -0.197131 Average |(XdotV)| 0.643394 TEST191 For the unit sphere in 3 dimensions: SPHERE_UNIT_SAMPLE_3D samples; A few sample values: 0.795416 -0.223966 -0.563163 -0.696321 -0.284310 0.659018 0.901719 0.397757 -0.169386 0.674043 0.557308 -0.484844 -0.272750 -0.305351 -0.912342 Now average the points, which should get a value close to zero, and closer as N_SAMPLE increases. Average: 0.011231 0.018262 -0.001727 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. V: -0.159238 -0.835329 -0.526183 Average |(XdotV)| 0.503798 V: 0.326524 -0.253713 0.910501 Average |(XdotV)| 0.509729 V: -0.093655 -0.983536 -0.154550 Average |(XdotV)| 0.497744 V: 0.515204 0.518383 0.682528 Average |(XdotV)| 0.505148 V: 0.857298 0.257252 -0.445940 Average |(XdotV)| 0.498380 TEST192 For the unit sphere in 3 dimensions: SPHERE_UNIT_SAMPLE_3D_2 samples; A few sample values: 0.609872 -0.171722 0.773671 -0.472500 -0.192923 -0.859956 0.882745 0.389387 0.262942 0.557775 0.461177 0.690074 -0.091438 -0.102367 0.990535 Now average the points, which should get a value close to zero, and closer as N_SAMPLE increases. Average: 0.014671 0.017093 -0.001434 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. V: -0.126855 -0.665452 0.735583 Average |(XdotV)| 0.560237 V: 0.110647 -0.085974 -0.990134 Average |(XdotV)| 0.639146 V: -0.092014 -0.966305 0.240390 Average |(XdotV)| 0.423899 V: 0.337146 0.339226 -0.878213 Average |(XdotV)| 0.606969 V: 0.732275 0.219736 0.644585 Average |(XdotV)| 0.515108 TEST193 For the unit sphere in N dimensions: SPHERE_UNIT_SAMPLE_ND samples; A few sample values: -0.563163 0.544577 0.621517 -0.169386 0.477838 0.861962 -0.912342 -0.358883 -0.197066 -0.197387 0.582876 -0.788222 0.795008 0.491897 0.354964 Spatial dimension = 3 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N increases. Average: 0.030880 0.010031 -0.007365 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. V: -0.339619 0.919418 -0.198316 Average |(XdotV)| 0.408130 V: -0.859971 -0.321067 0.396694 Average |(XdotV)| 0.511034 V: -0.078837 -0.001260 0.996887 Average |(XdotV)| 0.616625 V: -0.090849 0.234495 -0.967863 Average |(XdotV)| 0.604203 V: 0.029875 -0.457946 -0.888478 Average |(XdotV)| 0.571806 TEST194 For the unit sphere in N dimensions: SPHERE_UNIT_SAMPLE2_ND samples; A few sample values: -0.595532 0.773263 -0.217728 -0.416733 -0.170154 0.892962 0.308949 0.732983 0.606041 -0.495992 -0.555276 -0.667578 0.478214 0.025785 -0.877865 Spatial dimension = 3 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N increases. Average: 0.029973 -0.012540 0.004439 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. V: 0.355676 0.880449 -0.313534 Average |(XdotV)| 0.495168 V: 0.677421 -0.654813 -0.335143 Average |(XdotV)| 0.501544 V: -0.161204 0.957443 0.239406 Average |(XdotV)| 0.509084 V: 0.023796 0.201118 -0.979278 Average |(XdotV)| 0.487594 V: 0.270339 -0.750812 0.602659 Average |(XdotV)| 0.501105 TEST195 For the unit sphere in N dimensions: SPHERE_UNIT_SAMPLE3_ND samples; A few sample values: 0.138221 -0.189744 -0.972056 0.290560 -0.950577 -0.109446 -0.244469 0.630839 0.736395 -0.349232 0.760003 -0.548117 0.464237 0.149042 0.873081 Spatial dimension = 3 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N increases. Average: 0.010652 -0.025063 0.023125 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. V: 0.344740 0.215308 0.913672 Average |(XdotV)| 0.495086 V: -0.725816 -0.570666 0.384099 Average |(XdotV)| 0.512422 V: 0.614104 0.678902 0.402452 Average |(XdotV)| 0.517617 V: -0.303734 -0.344136 0.888435 Average |(XdotV)| 0.496253 V: 0.697872 0.714651 -0.047419 Average |(XdotV)| 0.492769 TEST1955: SPHERE_UNIT_VOLUME_ND evaluates the area of the unit sphere in N dimensions. SPHERE_UNIT_VOLUME_VALUES returns some test values. DIM_NUM Exact Computed Volume Volume 1 2.000000 2.000000 2 3.141593 3.141593 3 4.188790 4.188790 4 4.934802 4.934802 5 5.263789 5.263789 6 5.167713 5.167713 7 4.724766 4.724766 8 4.058712 4.058712 9 3.298509 3.298509 10 2.550164 2.550164 11 1.884104 1.884104 12 1.335263 1.335263 13 0.910629 0.910629 14 0.599265 0.599265 15 0.381443 0.381443 16 0.235331 0.235331 17 0.140981 0.140981 18 0.082146 0.082146 19 0.046622 0.046622 20 0.025807 0.025807 TEST196 For a shape in 2D, SHAPE_POINT_DIST_2D computes the distance to a point; Number of sides: 4 Center of square: 1 3.000000 2 0.000000 Square vertex #1 1 5.000000 2 0.000000 I X Y DIST 1 3.000000 0.000000 1.414214 2 5.000000 0.000000 0.000000 3 4.000000 0.000000 0.707107 4 10.000000 0.000000 5.000000 5 8.000000 5.000000 5.830952 6 6.000000 6.000000 6.082763 7 1.000000 2.000000 2.000000 8 2.500000 -0.500000 1.414214 9 4.000000 -1.000000 1.414214 TEST197 For a shape in 2D, SHAPE_POINT_DIST_2D computes the distance to a point; Number of sides: 6 Center of hexagon: 1 3.000000 2 0.000000 Hexagon vertex #1 1 5.000000 2 0.000000 I X Y DIST 1 3.000000 0.000000 1.732051 2 5.000000 0.000000 0.000000 3 4.000000 0.000000 0.866025 4 10.000000 0.000000 5.000000 5 4.000000 1.732051 2.000000 6 5.000000 3.464102 3.464102 7 3.000000 1.732051 3.464102 8 3.000000 0.866025 2.598076 TEST198 For a shape in 2D, SHAPE_POINT_NEAR_2D computes the nearest point to a point; Number of sides: 6 Hexagon center: 1 3.000000 2 0.000000 Hexagon vertex #1: 5.000000 0.000000 I X Y PN Dist 1 3.000000 0.000000 3.000000 0.000000 1.732051 2 5.000000 0.000000 5.000000 0.000000 0.000000 3 4.000000 0.000000 4.750000 0.433013 0.866025 4 10.000000 0.000000 5.000000 0.000000 5.000000 5 4.000000 1.732051 5.000000 -0.000000 2.000000 6 5.000000 3.464102 5.000000 -0.000000 3.464102 7 3.000000 1.732051 3.000000 -1.732051 3.464102 8 3.000000 0.866025 3.000000 -1.732051 2.598076 TEST199 For a shape in 2D, SHAPE_RAY_INT_2D computes the intersection of a shape and a ray whose origin is within the shape. Number of sides: 6 Hexagon center: 1 3.000000 2 0.000000 Hexagon vertex #1: 5.000000 0.000000 I XA YA XB YB XI YI 1 3.000000 0.000000 4.000000 0.000000 5.000000 0.000000 2 3.000000 0.000000 3.000000 1.000000 3.000000 3.464102 3 3.000000 -1.000000 3.000000 1.000000 3.000000 3.464102 4 3.000000 -1.000000 7.000000 5.000000 4.821367 1.732051 TEST200 SPHERE_TRIANGLE_SIDES_TO_ANGLES takes the sides of a spherical triangle and determines the angles. A = 2.058867 (radians) A = 117.964369 (degrees) Correct = 117.966667 (radians) B = 1.627136 (radians) B = 93.228029 (degrees) Correct = 93.230000 (radians) C = 1.227740 (radians) C = 70.344308 (degrees) Correct = 70.343333 (radians) TEST201 STRING_2D takes a set of line segments, and "strings" them together. I, (X1,Y1), (X2,Y2) 1 0.000000 0.000000 1.000000 1.000000 2 3.000000 4.000000 2.000000 4.000000 3 2.000000 2.000000 1.000000 3.000000 4 3.000000 2.000000 2.000000 3.000000 5 2.000000 1.000000 2.000000 2.000000 6 1.000000 1.000000 1.000000 2.000000 7 0.000000 5.000000 1.000000 6.000000 8 1.000000 2.000000 1.000000 3.000000 9 3.000000 2.000000 3.000000 3.000000 10 0.000000 0.000000 1.000000 0.000000 11 5.000000 5.000000 6.000000 6.000000 12 3.000000 3.000000 3.000000 4.000000 13 2.000000 4.000000 2.000000 3.000000 14 7.000000 4.000000 5.000000 5.000000 15 1.000000 0.000000 2.000000 1.000000 Found 4 groups of segments. STRING, ORDER, P1, P2 1 -3 2.000000 2.000000 2.000000 1.000000 1 -2 2.000000 1.000000 1.000000 0.000000 1 -1 1.000000 0.000000 0.000000 0.000000 1 0 0.000000 0.000000 1.000000 1.000000 1 1 1.000000 1.000000 1.000000 2.000000 1 2 1.000000 2.000000 1.000000 3.000000 1 3 1.000000 3.000000 2.000000 2.000000 2 -2 3.000000 2.000000 3.000000 3.000000 2 -1 3.000000 3.000000 3.000000 4.000000 2 0 3.000000 4.000000 2.000000 4.000000 2 1 2.000000 4.000000 2.000000 3.000000 2 2 2.000000 3.000000 3.000000 2.000000 3 0 0.000000 5.000000 1.000000 6.000000 4 -1 7.000000 4.000000 5.000000 5.000000 4 0 5.000000 5.000000 6.000000 6.000000 TEST202 SUPER_ELLIPSE_POINTS_2D returns points on a super ellipse; Superellipse center: 1 5.000000 2 -2.000000 radii R1 = 3.000000, R2 = 1.000000 exponent EXPO = 1.500000 and angle PSI = 0.523599 Sample points: Row: 1 2 Col 1 7.598076 -0.500000 2 7.400587 -0.461979 3 6.917084 -0.484923 4 6.247524 -0.593153 5 5.515595 -0.771716 6 4.867431 -0.980351 7 4.500000 -1.133975 8 4.183242 -1.375367 9 3.678478 -1.832376 10 3.157873 -2.376964 11 2.729362 -2.902705 12 2.467741 -3.309958 13 2.401924 -3.500000 14 2.599413 -3.538021 15 3.082916 -3.515077 16 3.752476 -3.406847 17 4.484405 -3.228284 18 5.132569 -3.019649 19 5.500000 -2.866025 20 5.816758 -2.624633 21 6.321522 -2.167624 22 6.842127 -1.623036 23 7.270638 -1.097295 24 7.532259 -0.690042 TEST203 For a tetrahedron in 3D, TETRAHEDRON_CENTROID_3D computes the centroid; 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: 1 0.000000 2 -0.172546 3 0.000000 TEST2031 For a tetrahedron in 3D, TETRAHEDRON_CONTAINS_POINT_3D finds if a point is inside; 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 TEST2032 For a tetrahedron in 3D, TETRAHEDRON_CIRCUMSPHERE_3D computes the circumsphere; 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: 1 0.000000 2 0.000000 3 0.204124 Circumsphere radius is 0.612372 TEST20321 For a tetrahedron in 3D, TETRAHEDRON_EDGE_LENGTH_3D computes the edge lengths; 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: 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 6 1.000000 TEST20322 For a tetrahedron in 3D, TETRAHEDRON_INSPHERE_3D computes the insphere; 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: 1 -0.000000 2 0.000000 3 0.204124 Insphere radius is 0.204124 TEST203224 TETRAHEDRON_LATTICE_LAYER_POINT_NEXT returns the next point in a tetrahedron lattice layer defined by: C(4) - 1 < X(1)/C(1) + X(2)/C(2) +X(3)/C(3) <= C(4). 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. TEST203225 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. TEST20323 For a tetrahedron in 3D, TETRAHEDRON_QUALITY1_3D computes quality measure #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.816497 4 0.000000 0.000000 0.816497 Tetrahedron quality is 0.580468 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 TEST203232 For a tetrahedron in 3D, TETRAHEDRON_QUALITY2_3D computes quality measure #2; 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.816497 4 0.000000 0.000000 0.816497 Tetrahedron quality is 0.565770 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 TEST203233 For a tetrahedron in 3D, TETRAHEDRON_QUALITY3_3D computes quality measure #3; 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.816497 4 0.000000 0.000000 0.816497 Tetrahedron quality is 0.686829 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 TEST203234 For a tetrahedron in 3D, TETRAHEDRON_QUALITY4_3D computes quality measure #4; 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.816497 4 0.000000 0.000000 0.816497 Tetrahedron quality is 0.476642 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.621320 TEST203235 For the cube, TETRAHEDRON_RHOMBIC_SIZE_3D returns dimension information; TETRAHEDRON_RHOMBIC_SHAPE_3D returns face and order information. SHAPE_PRINT_3D prints this information. Number of points = 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.816497 0.000000 0.000000 2 0.000000 -0.577350 0.000000 3 0.000000 0.577350 0.000000 4 0.000000 0.000000 0.816497 5 -0.408248 -0.288675 0.000000 6 -0.408248 0.288675 0.000000 7 -0.408248 0.000000 0.408248 8 0.000000 0.000000 0.000000 9 0.000000 -0.288675 0.408248 10 0.000000 0.288675 0.408248 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 TEST20324 TETRAHEDRON_SAMPLE_3D samples a tetrahedron. TETRAHEDRON_BARYCENTRIC_3D converts XYZ to XSI. We are computing the XSI coordinates just 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 (X,Y,Z) (XSI1,XSI2,XSI3,XSI4): 1.388984 4.014574 3.001498 0.602231 0.388984 0.007287 0.001498 1.112721 4.008224 3.058079 0.825088 0.112721 0.004112 0.058079 1.120614 4.021312 3.232467 0.636262 0.120614 0.010656 0.232467 1.035017 4.095236 3.058308 0.859057 0.035017 0.047618 0.058308 1.227945 4.054928 3.006983 0.737607 0.227945 0.027464 0.006983 1.831312 4.032399 3.029986 0.122502 0.831312 0.016200 0.029986 1.063531 4.826294 3.067761 0.455560 0.063531 0.413147 0.067761 1.019699 4.000548 3.036171 0.943856 0.019699 0.000274 0.036171 1.345321 4.003678 3.014342 0.638498 0.345321 0.001839 0.014342 1.266859 4.014596 3.020022 0.705821 0.266859 0.007298 0.020022 TEST20325 For the tetrahedron, TETRAHEDRON_SIZE_3D returns dimension information; TETRAHEDRON_SHAPE_3D returns face and order info. We will use this information to compute the areas and centers of each face. Number of points = 4 Number of edges = 6 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.942809 0.000000 -0.333333 2 -0.471405 0.816497 -0.333333 3 -0.471405 -0.816497 -0.333333 4 0.000000 0.000000 1.000000 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 Face Order Area 1 3 1.154701 2 3 1.154701 3 3 1.154701 4 3 1.154701 Face Center 1 -0.000000 0.000000 -0.333333 2 0.157135 0.272166 0.111111 3 0.157135 -0.272166 0.111111 4 -0.314270 0.000000 0.111111 TEST2033 For a tetrahedron in 3D, TETRAHEDRON_VOLUME_3D computes the volume; 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 Volume = 0.638429 TEST203 For a tetrahedron in 3D, TETRAHEDRON_CENTROID_3D computes the centroid; 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: 1 0.000000 2 -0.172546 3 0.000000 TEST203 For a tetrahedron in 3D, TETRAHEDRON_CENTROID_3D computes the centroid; 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: 1 0.000000 2 -0.172546 3 0.000000 TEST204 TMAT geometric transformation matrix routines: TMAT_INIT initializes, TMAT_ROT_AXIS for rotation about an axis, TMAT_ROT_VECTOR for rotation about a vector, TMAT_SCALE for scaling, TMAT_SHEAR for shear, TMAT_TRANS for translation Initial transformation matrix: Col: 1 2 3 4 Row 1 1 0 0 0 2 0 1 0 0 3 0 0 1 0 4 0 0 0 1 Transformation matrix for rotation about x by 30.000000 Col: 1 2 3 4 Row 1 1 0 0 0 2 0 0.866025 -0.5 0 3 0 0.5 0.866025 0 4 0 0 0 1 Transformation matrix for rotation about 1.000000 2.000000 3.000000 of 30.000000 Col: 1 2 3 4 Row 1 0.875595 -0.381753 0.29597 0 2 0.420031 0.904304 -0.0762129 0 3 -0.238552 0.191048 0.952152 0 4 0 0 0 1 Transformation matrix for scaling by 2.000000 0.500000 10.000000 Col: 1 2 3 4 Row 1 2 0 0 0 2 0 0.5 0 0 3 0 0 10 0 4 0 0 0 1 Transformation matrix for xy shear coefficient of 0.500000 Col: 1 2 3 4 Row 1 1 0.5 0 0 2 0 1 0 0 3 0 0 1 0 4 0 0 0 1 Transformation matrix for translation by 1.000000 2.000000 3.000000 Col: 1 2 3 4 Row 1 1 0 0 1 2 0 1 0 2 3 0 0 1 3 4 0 0 0 1 TEST205 TMAT_MXP2 applies a geometric transformation matrix to a set of points. Points: Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 0.000000 1.000000 0.000000 3 0.000000 0.000000 1.000000 4 1.000000 1.000000 1.000000 Initial transformation matrix: Col: 1 2 3 4 Row 1 1 0 0 0 2 0 1 0 0 3 0 0 1 0 4 0 0 0 1 Rotation about x by 30.000000 Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 0.000000 0.866025 0.500000 3 0.000000 -0.500000 0.866025 4 1.000000 0.366025 1.366025 Rotation about 1.000000 2.000000 3.000000 of 30.000000 Row: 1 2 3 Col 1 0.875595 0.420031 -0.238552 2 -0.381753 0.904304 0.191048 3 0.295970 -0.076213 0.952152 4 0.789812 1.248122 0.904648 Scaling by 2.000000 0.500000 10.000000 Row: 1 2 3 Col 1 2.000000 0.000000 0.000000 2 0.000000 0.500000 0.000000 3 0.000000 0.000000 10.000000 4 2.000000 0.500000 10.000000 xy shear coefficient of 0.500000 Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 0.500000 1.000000 0.000000 3 0.000000 0.000000 1.000000 4 1.500000 1.000000 1.000000 Translation by 1.000000 2.000000 3.000000 Row: 1 2 3 Col 1 2.000000 2.000000 3.000000 2 1.000000 3.000000 3.000000 3 1.000000 2.000000 4.000000 4 2.000000 3.000000 4.000000 TEST206 For a triangle in 2D, TRIANGLE_ANGLES_2D computes the angles; Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 Radians Degrees 0.785398 45.000000 1.570796 90.000000 0.785398 45.000000 TEST20605 For a triangle in 3D: TRIANGLE_ANGLES_3D computes the angles; Triangle vertices: Row: 1 2 3 Col 1 1.000000 2.000000 3.000000 2 2.414214 3.414214 3.000000 3 1.707107 2.707107 4.000000 Radians Degrees 0.785398 44.999999 0.785398 44.999995 1.570796 90.000006 TEST2061 For a triangle in 2D, TRIANGLE_AREA_2D computes the area; Triangle vertices (columns) Col: 1 2 3 Row 1 0 0 1 2 1 0 0 Triangle area is 0.500000 TEST2062 For a triangle in any dimension, TRIANGLE_AREA_HERON computes the area; Triangle vertices: Row: 1 2 3 Col 1 1.000000 0.000000 0.000000 2 0.000000 1.000000 0.000000 3 0.000000 0.000000 1.000000 Side lengths: 1 1.414214 2 1.414214 3 1.414214 The area is 0.866025 TEST209 For a triangle in 3D: TRIANGLE_AREA_3D computes the area; TRIANGLE_AREA_3D_2 computes the area; TRIANGLE_AREA_3D_3 computes the area; Triangle (vertices are columns) Col: 1 2 3 Row 1 1 2 3 2 2.41421 3.41421 3 3 1.70711 2.70711 4 Area #1 1.118034 Area #2 1.118034 Area #3 1.118034 TEST20655 For a triangle in 2D, TRIANGLE_BARYCENTRIC_2D converts XY coordinates to barycentric XSI coordinates; Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 X Y XSI 0.250000 0.250000 0.250000 0.750000 0.250000 0.250000 1.000000 1.000000 1.000000 11.000000 0.500000 0.500000 0.000000 1.000000 1.000000 0.500000 -10.000000 -10.000000 0.600000 0.600000 0.600000 TEST2066 For a triangle in 2D: TRIANGLE_CENTROID_2D computes the centroid. Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.000000 1.000000 Centroid: 1 0.333333 2 0.333333 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 0.866025 Centroid: 1 0.500000 2 0.288675 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 10.000000 Centroid: 1 0.500000 2 3.333333 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 10.000000 2.000000 Centroid: 1 3.666667 2 0.666667 TEST2094 For a triangle in 3D: TRIANGLE_CENTROID_3D computes the centroid. Triangle vertices: Row: 1 2 3 Col 1 1.000000 2.000000 3.000000 2 2.414214 3.414214 3.000000 3 1.707107 2.707107 4.000000 Centroid: 1 1.707107 2 2.707107 3 3.333333 TEST2101 For a triangle in 2D, the circumcenter can be computed by: TRIANGLE_CIRCUMCENTER_2D; TRIANGLE_CIRCUMCENTER_2D_2; TRIANGLE_CIRCUMCENTER (any dimension) Triangle vertices ( columns ) Col: 1 2 3 Row 1 10 11 10 2 5 5 6 Circumcenter by TRIANGLE_CIRCUMCENTER_2D: 1 10.500000 2 5.500000 Circumcenter by TRIANGLE_CIRCUMCENTER_2D_2: 1 10.500000 2 5.500000 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 10.500000 2 5.500000 Triangle vertices ( columns ) Col: 1 2 3 Row 1 10 11 10.5 2 5 5 5.86603 Circumcenter by TRIANGLE_CIRCUMCENTER_2D: 1 10.500000 2 5.288675 Circumcenter by TRIANGLE_CIRCUMCENTER_2D_2: 1 10.500000 2 5.288675 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 10.500000 2 5.288675 Triangle vertices ( columns ) Col: 1 2 3 Row 1 10 11 10.5 2 5 5 15 Circumcenter by TRIANGLE_CIRCUMCENTER_2D: 1 10.500000 2 9.987500 Circumcenter by TRIANGLE_CIRCUMCENTER_2D_2: 1 10.500000 2 9.987500 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 10.500000 2 9.987500 Triangle vertices ( columns ) Col: 1 2 3 Row 1 10 11 20 2 5 5 7 Circumcenter by TRIANGLE_CIRCUMCENTER_2D: 1 10.500000 2 28.500000 Circumcenter by TRIANGLE_CIRCUMCENTER_2D_2: 1 10.500000 2 28.500000 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 10.500000 2 28.500000 TEST21011 For a triangle in M dimensions, the circumenter can be computed by: TRIANGLE_CIRCUMCENTER; M2 = 2 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 6.756353 2 12.479010 Distances from circumcenter to vertices: 0.533001 0.533001 0.533001 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 6.974620 2 12.429159 Distances from circumcenter to vertices: 0.653938 0.653938 0.653938 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 13.691808 2 10.894986 Distances from circumcenter to vertices: 7.339086 7.339086 7.339086 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 48.591694 2 2.924021 Distances from circumcenter to vertices: 43.124048 43.124048 43.124048 M2 = 3 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 4.959256 2 12.448250 3 8.912616 Distances from circumcenter to vertices: 0.646826 0.646826 0.646826 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 4.986113 2 12.452801 3 8.900298 Distances from circumcenter to vertices: 0.643991 0.643991 0.643991 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 9.084466 2 13.147248 3 7.020551 Distances from circumcenter to vertices: 4.561227 4.561227 4.561227 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 76.627399 2 24.592085 3 -23.958624 Distances from circumcenter to vertices: 79.703076 79.703076 79.703076 M2 = 4 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 3.960686 2 10.814568 3 10.158217 4 7.114790 Distances from circumcenter to vertices: 0.733734 0.733734 0.733734 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 3.764578 2 10.890725 3 10.117458 4 7.121579 Distances from circumcenter to vertices: 0.822921 0.822921 0.822921 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 7.008104 2 9.631132 3 10.791584 4 7.009296 Distances from circumcenter to vertices: 3.192932 3.192932 3.192932 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 114.696370 2 -32.188576 3 33.173218 4 3.281407 Distances from circumcenter to vertices: 120.847616 120.847616 120.847616 M2 = 5 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 2.981890 2 11.916499 3 9.992180 4 6.096668 5 7.985115 Distances from circumcenter to vertices: 0.744628 0.744628 0.744628 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 2.981835 2 11.918562 3 10.002156 4 6.105633 5 7.948342 Distances from circumcenter to vertices: 0.753036 0.753036 0.753036 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 2.988263 2 11.675907 3 8.828922 4 5.051315 5 12.273010 Distances from circumcenter to vertices: 4.489448 4.489448 4.489448 Circumcenter by TRIANGLE_CIRCUMCENTER: 1 3.122417 2 6.611272 3 -15.658540 4 -16.954159 5 102.536457 Distances from circumcenter to vertices: 100.645654 100.645654 100.645654 TEST2067 For a triangle in 2D: TRIANGLE_CIRCUMCIRCLE_2D computes the circumcenter. TRIANGLE_CIRCUMCIRCLE_2D_2 computes the circumcenter. Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.000000 1.000000 Circumcenter 1 0.500000 2 0.500000 Circumradius: 0.707107 Circumcenter2 1 0.500000 2 0.500000 Circumradius2: 0.707107 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 0.866025 Circumcenter 1 0.500000 2 0.288675 Circumradius: 0.577350 Circumcenter2 1 0.500000 2 0.288675 Circumradius2: 0.577350 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 10.000000 Circumcenter 1 0.500000 2 4.987500 Circumradius: 5.012500 Circumcenter2 1 0.500000 2 4.987500 Circumradius2: 5.012500 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 10.000000 2.000000 Circumcenter 1 0.500000 2 23.500000 Circumradius: 23.505319 Circumcenter2 1 0.500000 2 23.500000 Circumradius2: 23.505319 TEST21015 For a triangle in 2D: TRIANGLE_CIRCUMRADIUS_2D computes the circumradius. Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.000000 1.000000 Circumradius: 0.707107 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 0.866025 Circumradius: 0.577350 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 10.000000 Circumradius: 5.012500 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 10.000000 2.000000 Circumradius: 23.505319 TEST2068 TRIANGLE_CONTAINS_LINE_EXP_3D determines whether a triangle "contains" an explicit line in 3D. Triangle vertices: Row: 1 2 3 Col 1 8.000000 4.000000 2.000000 2 9.000000 0.000000 5.000000 3 2.000000 1.000000 2.000000 Line point P1: 1 3.000000 2 0.000000 3 -7.000000 Line point P2: 1 5.000000 2 1.000000 3 -2.000000 The triangle contains the line. Intersection point: 1 7.000000 2 2.000000 3 3.000000 Expected answer: The triangle contains the line, and the intersection point is at: 7, 2, 3. TEST2069 TRIANGLE_CONTAINS_LINE_PAR_3D determines whether a triangle "contains" a parametric line in 3D. Triangle vertices: Row: 1 2 3 Col 1 8.000000 4.000000 2.000000 2 9.000000 0.000000 5.000000 3 2.000000 1.000000 2.000000 Parametric base point P0: 1 3.000000 2 0.000000 3 -7.000000 Parametric direction PD: 1 0.365148 2 0.182574 3 0.912871 The triangle contains the line. Intersection point: 1 7.000000 2 2.000000 3 3.000000 Expected answer: The triangle contains the line, and the intersection point is at: ( 7, 2, 3 ). TEST207 For a triangle in 2D, TRIANGLE_CONTAINS_POINT_2D_1 reports if a point is inside a triangle (and doesn't care about the ordering of the vertices) TRIANGLE_CONTAINS_POINT_2D_2 reports if a point is inside a triangle (and DOES care about the ordering of the vertices) TRIANGLE_CONTAINS_POINT_2D_3 reports if a point is inside a triangle (and doesn't care about the ordering of the vertices) Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 X Y In1 In2 In3 0.250000 0.250000 1 1 1 0.750000 0.250000 1 1 1 1.000000 1.000000 0 0 0 11.000000 0.500000 0 0 0 0.000000 1.000000 1 1 1 0.500000 -10.000000 0 0 0 0.600000 0.600000 0 0 0 Repeat the test, but reverse the triangle vertex ordering. Triangle vertices (reversed): Row: 1 2 Col 1 1.000000 0.000000 2 0.000000 0.000000 3 0.000000 1.000000 X Y In1 In2 In3 0.250000 0.250000 1 0 1 0.750000 0.250000 1 0 1 1.000000 1.000000 0 0 0 11.000000 0.500000 0 0 0 0.000000 1.000000 1 0 1 0.500000 -10.000000 0 0 0 0.600000 0.600000 0 0 0 TEST2075 TRIANGLE_DIAMETER_2D computes the diameter of the SMALLEST circle around the triangle. Triangle vertices: Row: 1 2 Col 1 4.000000 2.000000 2 1.000000 5.000000 3 -2.000000 2.000000 Diameter = 6.000000 Triangle vertices: Row: 1 2 Col 1 4.000000 2.000000 2 5.000000 4.000000 3 6.000000 6.000000 Diameter = 6.000000 Triangle vertices: Row: 1 2 Col 1 4.000000 2.000000 2 1.000000 5.000000 3 4.000000 2.000000 Diameter = 0.000000 TEST208 For a triangle in 2D, TRIANGLE_GRIDPOINTS_2D produces a set of gridpoints in or on the triangle. Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 Number of grid points is 10 Grid points: Col: 1 2 3 4 5 Row 1 1 0.666667 0.333333 0 0.666667 2 0 0 0 0 0.333333 Col: 6 7 8 9 10 Row 1 0.333333 0 0.333333 0 0 2 0.333333 0.333333 0.666667 0.666667 1 TEST2102 For a triangle in 2D: TRIANGLE_INCENTER_2D computes the incenter. Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.000000 1.000000 Incenter 1 0.292893 2 0.292893 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 0.866025 Incenter 1 0.500000 2 0.288675 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 10.000000 Incenter 1 0.500000 2 0.475625 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 10.000000 2.000000 Incenter 1 0.989247 2 0.097955 TEST2070 For a triangle in 2D, TRIANGLE_INCIRCLE_2D computes the incircle. Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 Incenter 1 0.292893 2 0.292893 Incircle radius is 0.292893 TEST20701 For a triangle in 2D, TRIANGLE_INRADIUS_2D computes the inradius. Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 Incircle radius is 0.292893 TEST2104 TRIANGLE_LATTICE_LAYER_POINT_NEXT returns the next point in a triangle lattice layer defined by: C(3) - 1 < X(1)/C(1) + X(2)/C(2) <= C(3). N = 2 C = 2 3 Layer 0 1 0 0 No more. Layer 1 1 1 0 2 2 0 3 0 1 4 1 1 5 0 2 6 0 3 No more. Layer 2 1 3 0 2 4 0 3 2 1 4 3 1 5 1 2 6 2 2 7 1 3 8 2 3 9 0 4 10 1 4 11 0 5 12 0 6 No more. Layer 3 1 5 0 2 6 0 3 4 1 4 5 1 5 3 2 6 4 2 7 3 3 8 4 3 9 2 4 10 3 4 11 1 5 12 2 5 13 1 6 14 2 6 15 0 7 16 1 7 17 0 8 18 0 9 No more. Layer 4 1 7 0 2 8 0 3 6 1 4 7 1 5 5 2 6 6 2 7 5 3 8 6 3 9 4 4 10 5 4 11 3 5 12 4 5 13 3 6 14 4 6 15 2 7 16 3 7 17 1 8 18 2 8 19 1 9 20 2 9 21 0 10 22 1 10 23 0 11 24 0 12 No more. TEST2105 TRIANGLE_LATTICE_POINT_NEXT returns the next lattice point in a triangle defined by: 0 <= X(1)/C(1) + X(2)/C(2) <= C(3). N = 2 C = 3 2 1 1 0 0 2 1 0 3 2 0 4 3 0 5 0 1 6 1 1 7 0 2 No more. TEST211 TRIANGLE_ORIENTATION_2D determines orientation of a triangle. Triangle vertices: Row: 1 2 Col 1 4.000000 2.000000 2 1.000000 5.000000 3 -2.000000 2.000000 The points are counterclockwise. Triangle vertices: Row: 1 2 Col 1 1.000000 5.000000 2 4.000000 2.000000 3 1.000000 -1.000000 The points are clockwise. Triangle vertices: Row: 1 2 Col 1 1.000000 5.000000 2 2.000000 7.000000 3 3.000000 9.000000 The points are colinear. Triangle vertices: Row: 1 2 Col 1 1.000000 5.000000 2 4.000000 2.000000 3 1.000000 5.000000 The points are not distinct. TEST2103 For a triangle in 2D: TRIANGLE_ORTHOCENTER_2D computes the orthocenter. Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.000000 1.000000 Orthocenter 1 0.000000 2 0.000000 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 0.866025 Orthocenter 1 0.500000 2 0.288675 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 10.000000 Orthocenter 1 0.500000 2 0.025000 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 10.000000 2.000000 Orthocenter 1 10.000000 2 -45.000000 TEST2071 For a triangle in 2D, TRIANGLE_POINT_DIST_2D computes the distance to a point; Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 P DIST 0.250000 0.250000 0.250000 0.750000 0.250000 0.000000 1.000000 1.000000 0.707107 11.000000 0.500000 10.012492 0.000000 1.000000 0.000000 0.500000 -10.000000 10.000000 0.600000 0.600000 0.141421 TEST20715 For a triangle in 2D, TRIANGLE_POINT_DIST_SIGNED_2D computes signed distance to a point; Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 P DIST_SIGNED 0.250000 0.250000 -0.250000 0.750000 0.250000 0.000000 1.000000 1.000000 0.707107 11.000000 0.500000 10.012492 0.000000 1.000000 0.000000 0.500000 -10.000000 10.000000 0.600000 0.600000 0.141421 TEST2095 For a triangle in 3D: TRIANGLE_POINT_DIST_3D computes the distance to a point; Triangle vertices: Row: 1 2 3 Col 1 1.000000 2.000000 3.000000 2 2.414214 3.414214 3.000000 3 1.707107 2.707107 4.000000 P DIST 1.000000 2.000000 3.000000 0.000000 1.353553 2.353553 3.000000 0.000000 0.000000 0.000000 0.000000 3.741657 TEST2072 For a triangle in 2D, TRIANGLE_POINT_NEAR_2D computes the nearest point to a point. Triangle vertices: Row: 1 2 Col 1 0.000000 1.000000 2 0.000000 0.000000 3 1.000000 0.000000 P PN 0.250000 0.250000 0.000000 0.250000 0.750000 0.250000 0.750000 0.250000 1.000000 1.000000 0.500000 0.500000 11.000000 0.500000 1.000000 0.000000 0.000000 1.000000 0.000000 1.000000 0.500000 -10.000000 0.500000 0.000000 0.600000 0.600000 0.500000 0.500000 TEST2115 For a triangle in 2D: TRIANGLE_QUALITY_2D computes the quality. Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.000000 1.000000 Quality = 0.828427 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 0.866025 Quality = 1.000000 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 0.500000 10.000000 Quality = 0.189775 Triangle vertices: Row: 1 2 Col 1 0.000000 0.000000 2 1.000000 0.000000 3 10.000000 2.000000 Quality = 0.008335 TEST212 TRIANGLE_SAMPLE samples a triangle. TRIANGLE_XY_TO_XSI_2D converts XY to XSI coordinates. We are computing the XSI coordinates just to verify that the points are inside the triangle. Triangle vertices: Row: 1 2 Col 1 4.000000 2.000000 2 1.000000 5.000000 3 -2.000000 2.000000 Sample points (X,Y) and (XSI1,XSI2,XSI3) coordinates: -0.353891 2.627246 0.169811 0.209082 0.621108 1.817539 3.844883 0.328776 0.614961 0.056263 1.253316 2.124408 0.521485 0.041469 0.437046 1.861843 2.203980 0.609644 0.067993 0.322363 -0.393801 2.008508 0.266282 0.002836 0.730882 2.789886 2.467480 0.720401 0.155827 0.123772 2.077866 2.037330 0.673423 0.012443 0.314134 3.637518 2.045969 0.931925 0.015323 0.052752 -1.068170 2.356119 0.095952 0.118706 0.785342 2.779760 2.523231 0.709422 0.174410 0.116168 TEST213 TRIANGLE_SAMPLE samples a triangle. TRIANGLE_XY_TO_XSI_2D converts XY to XSI coordinates. TRIANGLE_XSI_TO_XY_2D converts XSI to XY coordinates. We verify that (X,Y) -> (XSI1,XSI2,XSI3) -> (X,Y) works properly. Triangle vertices: Row: 1 2 Col 1 4.000000 2.000000 2 1.000000 5.000000 3 -2.000000 2.000000 Sample points: 1.000000 3.000000 0.333333 0.333333 0.333333 1.000000 3.000000 3.000000 0.000000 1.166667 -0.666667 0.500000 3.000000 0.000000 1.247111 2.305760 0.490225 0.101920 0.407855 1.247111 2.305760 0.235140 2.176066 0.343179 0.058689 0.598132 0.235140 2.176066 2.383210 2.941821 0.573565 0.313940 0.112495 2.383210 2.941821 2.699784 2.988758 0.618504 0.329586 0.051910 2.699784 2.988758 -0.418553 3.175598 0.067642 0.391866 0.540492 -0.418553 3.175598 1.452960 3.902114 0.258474 0.634038 0.107488 1.452960 3.902114 -0.494375 3.047206 0.076403 0.349069 0.574528 -0.494375 3.047206 1.310597 2.865071 0.407588 0.288357 0.304055 1.310597 2.865071 TEST219 TUBE_2D computes corners of a tube of radius DIST surrounding a sequence of points. Test number 1 Number of points N = 4 Tube radius DIST = 0.500000 Points to surround: Row: 1 2 Col 1 0.000000 0.000000 2 4.000000 3.000000 3 4.000000 0.000000 4 0.000000 0.000000 P1: Row: 1 2 Col 1 -0.100000 -0.700000 2 4.500000 2.750000 3 4.500000 -0.500000 4 -0.500000 -0.500000 P2: Row: 1 2 Col 1 -0.700000 0.100000 2 3.500000 3.250000 3 3.500000 0.500000 4 -0.500000 0.500000 Test number 2 Number of points N = 5 Tube radius DIST = 0.500000 Points to surround: Row: 1 2 Col 1 0.000000 0.000000 2 2.000000 0.000000 3 2.000000 1.000000 4 0.000000 1.000000 5 0.000000 0.000000 P1: Row: 1 2 Col 1 -0.500000 -0.500000 2 2.500000 -0.500000 3 2.500000 1.500000 4 -0.500000 1.500000 5 -0.500000 -0.500000 P2: Row: 1 2 Col 1 -0.500000 0.500000 2 1.500000 0.500000 3 1.500000 0.500000 4 0.500000 0.500000 5 0.500000 -0.500000 Test number 3 Number of points N = 5 Tube radius DIST = 1.000000 Points to surround: Row: 1 2 Col 1 10.000000 20.000000 2 20.000000 20.000000 3 10.000000 10.000000 4 20.000000 10.000000 5 10.000000 20.000000 P1: Row: 1 2 Col 1 9.000000 19.000000 2 20.414214 19.000000 3 10.414214 9.000000 4 21.000000 9.000000 5 8.585786 20.000000 P2: Row: 1 2 Col 1 9.000000 21.000000 2 19.585786 21.000000 3 9.585786 11.000000 4 21.000000 11.000000 5 10.000000 21.414214 Test number 4 Number of points N = 5 Tube radius DIST = 1.000000 Points to surround: Row: 1 2 Col 1 0.000000 0.000000 2 10.000000 0.000000 3 10.000000 10.000000 4 10.000000 0.000000 5 0.000000 0.000000 P1: Row: 1 2 Col 1 -1.000000 -1.000000 2 11.000000 -1.000000 3 11.000000 11.000000 4 11.000000 -1.000000 5 -1.000000 -1.000000 P2: Row: 1 2 Col 1 -1.000000 1.000000 2 9.000000 1.000000 3 9.000000 11.000000 4 9.000000 1.000000 5 -1.000000 1.000000 TEST220 VECTOR_DIRECTIONS_ND computes the angles that a vector makes with the axes. X Y AX AY AX AY (__Radians___) (___Degrees___) 1.000000 0.000000 0.000000 1.570796 0.000000 90.000000 1.732051 1.000000 0.523599 1.047198 30.000000 60.000000 -1.732051 1.000000 2.617994 1.047198 150.000000 60.000000 -1.732051 -1.000000 2.617994 2.094395 150.000000 120.000000 1.732051 -1.000000 0.523599 2.094395 30.000000 120.000000 TEST221 VECTOR_DIRECTIONS_ND computes the angles that a vector makes with the axes. X Y Z AX AY AZ AX AY AZ (_____Radians_______) (_______Degrees_______) 1.000000 0.000000 0.000000 0.000000 1.570796 1.570796 0.000000 90.000000 90.000000 1.000000 2.000000 3.000000 1.300247 1.006854 0.640522 74.498640 57.688467 36.699225 0.000000 0.000000 1.000000 1.570796 1.570796 0.000000 90.000000 90.000000 0.000000 TEST222 VECTOR_ROTATE_2D rotates a vector through a given angle around the origin. X1 Y1 Angle X2 Y2 1.000000 0.000000 30.000000 0.866025 0.500000 0.000000 2.000000 -45.000000 1.414214 1.414214 1.000000 1.000000 270.000000 1.000000 -1.000000 TEST2225 VECTOR_ROTATE_3D rotates a vector through a given angle around the origin. Rotations will be about the following axis: 1.000000 1.000000 1.000000 V1 Angle V2 ---------------------- ------ ---------------------- 1.000000 0.000000 0.000000 30.000000 0.910684 0.333333 -0.244017 0.000000 2.000000 0.000000 -45.000000 1.011759 1.609476 -0.621234 0.000000 0.000000 3.000000 90.000000 2.732051 -0.732051 1.000000 1.000000 1.000000 1.000000 270.000000 1.000000 1.000000 1.000000 1.000000 1.000000 -2.000000 30.000000 0.000000 1.732051 -1.732051 Rotations will be about the following axis: 0.000000 0.000000 2.000000 V1 Angle V2 ---------------------- ------ ---------------------- 1.000000 1.000000 1.000000 90.000000 -1.000000 1.000000 1.000000 TEST223 VECTOR_ROTATE_BASE_2D rotates a vector (X1,Y1) through an angle around a base point (XB,YB). P1 PB Angle P2 11.000000 5.000000 10.000000 5.000000 30.000000 10.866025 5.500000 10.000000 7.000000 10.000000 5.000000 -45.000000 11.414214 6.414214 11.000000 6.000000 10.000000 5.000000 270.000000 11.000000 4.000000 10.000000 5.000000 10.000000 5.000000 20.000000 10.000000 5.000000 TEST224 VECTOR_SEPARATION_3D computes the separation angle between two vectors. -----Vector 1----- -----Vector 2----- Radians Degrees 1.000000 0.000000 0.000000 1.000000 2.000000 3.000000 1.300247 74.498640 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.570796 90.000000 1.000000 0.000000 0.000000 -3.000000 2.000000 -1.000000 2.501070 143.300775 1.000000 0.000000 0.000000 -2.000000 -4.000000 -6.000000 1.841346 105.501360 1.000000 2.000000 3.000000 0.000000 0.000000 1.000000 0.640522 36.699225 1.000000 2.000000 3.000000 -3.000000 2.000000 -1.000000 1.714144 98.213211 1.000000 2.000000 3.000000 -2.000000 -4.000000 -6.000000 3.141593 180.000000 0.000000 0.000000 1.000000 -3.000000 2.000000 -1.000000 1.841346 105.501360 0.000000 0.000000 1.000000 -2.000000 -4.000000 -6.000000 2.501070 143.300775 -3.000000 2.000000 -1.000000 -2.000000 -4.000000 -6.000000 1.427449 81.786789 TEST2245 VOXELS_DIST_L1_ND prints the voxels on a line in 3D. P1: 1 1 5 P2: 9 4 4 L1 distance = 12 TEST225 VOXELS_LINE_3D computes the voxels on a line in 3D starting at the first voxel, and heading towards the second one. Starting voxel: 1 1 5 "Heading" voxel: 9 4 4 Number of voxels we will compute is 13 The voxels: Row: 1 2 3 Col 1 1 1 5 2 2 1 5 3 2 2 5 4 3 2 5 5 4 2 5 6 5 2 5 7 5 3 5 8 5 3 4 9 6 3 4 10 7 3 4 11 8 3 4 12 8 4 4 13 9 4 4 TEST226 VOXELS_REGION_3D groups voxels into regions. Number of regions found = 3 The nonzero ISHOW array elements are: 2 4 1 1 2 5 1 1 2 7 1 1 3 3 1 1 3 4 1 1 3 5 1 1 3 6 1 1 3 7 1 1 4 4 1 1 4 5 1 1 4 7 1 1 5 7 1 1 6 2 1 2 6 3 1 2 6 6 1 1 6 7 1 1 7 3 1 2 8 8 1 3 The stack-based list of regions is: Region 3 include 1 voxels: 8 8 1 Region 2 include 3 voxels: 7 3 1 6 3 1 6 2 1 Region 1 include 14 voxels: 6 7 1 6 6 1 5 7 1 4 7 1 3 7 1 2 7 1 4 5 1 4 4 1 3 6 1 3 5 1 3 4 1 3 3 1 2 5 1 2 4 1 TEST227 VOXELS_STEP_3D steps along a line from one voxel to another. 0 1 1 5 1 2 1 5 2 2 2 5 3 3 2 5 4 4 2 5 5 5 3 4 6 6 3 4 7 7 3 4 8 7 4 4 9 8 4 4 10 9 4 4 Now, as a check, reverse direction and return. 0 9 4 4 1 8 4 4 2 8 3 4 3 7 3 4 4 6 3 4 5 5 2 5 6 4 2 5 7 3 2 5 8 3 1 5 9 2 1 5 10 1 1 5 GEOMETRY_TEST Normal end of execution. 04-Dec-2010 11:04:56 >>