June 24 2002 11:29:48.902 AM GEOMETRY_PRB A set of test programs for GEOMETRY. TEST00 Call RANDOM_SEED to initialize the random number generator. Input SEED = 123456789 TEST01 ANGLE_CONTAINS_RAY_2D sees if a ray lies within an angle. ANGLE_RAD_2D computes the angle between two rays; Angle = 0.785398 Vertex A : ( 1.00000 , 0.00000 ) Vertex B : ( 0.00000 , 0.00000 ) Vertex C : ( 1.00000 , 1.00000 ) X Y Inside? 1.00000 0.00000 T 0.866025 0.500000 T 0.500000 0.866025 F -0.437114E-07 1.00000 F -0.500000 0.866025 F -0.866025 0.500000 F -1.00000 -0.874228E-07 F -0.866025 -0.500000 F -0.500000 -0.866025 F 0.119249E-07 -1.00000 F 0.500000 -0.866025 F 0.866026 -0.500000 F 1.00000 0.174846E-06 T Angle = 1.57080 Vertex A : ( 1.00000 , 0.00000 ) Vertex B : ( 0.00000 , 0.00000 ) Vertex C : ( 0.00000 , 1.00000 ) X Y Inside? 1.00000 0.00000 T 0.866025 0.500000 T 0.500000 0.866025 T -0.437114E-07 1.00000 T -0.500000 0.866025 F -0.866025 0.500000 F -1.00000 -0.874228E-07 F -0.866025 -0.500000 F -0.500000 -0.866025 F 0.119249E-07 -1.00000 F 0.500000 -0.866025 F 0.866026 -0.500000 F 1.00000 0.174846E-06 T Angle = 2.35619 Vertex A : ( 1.00000 , -1.00000 ) Vertex B : ( 0.00000 , 0.00000 ) Vertex C : ( 0.00000 , 1.00000 ) X Y Inside? 1.00000 0.00000 T 0.866025 0.500000 T 0.500000 0.866025 T -0.437114E-07 1.00000 T -0.500000 0.866025 F -0.866025 0.500000 F -1.00000 -0.874228E-07 F -0.866025 -0.500000 F -0.500000 -0.866025 F 0.119249E-07 -1.00000 F 0.500000 -0.866025 F 0.866026 -0.500000 T 1.00000 0.174846E-06 T Angle = 3.14159 Vertex A : ( 1.00000 , 0.00000 ) Vertex B : ( 0.00000 , 0.00000 ) Vertex C : ( -1.00000 , 0.00000 ) X Y Inside? 1.00000 0.00000 T 0.866025 0.500000 T 0.500000 0.866025 T -0.437114E-07 1.00000 T -0.500000 0.866025 T -0.866025 0.500000 T -1.00000 -0.874228E-07 F -0.866025 -0.500000 F -0.500000 -0.866025 F 0.119249E-07 -1.00000 F 0.500000 -0.866025 F 0.866026 -0.500000 F 1.00000 0.174846E-06 T Angle = 4.71239 Vertex A : ( 1.00000 , 0.00000 ) Vertex B : ( 0.00000 , 0.00000 ) Vertex C : ( 0.00000 , -1.00000 ) X Y Inside? 1.00000 0.00000 T 0.866025 0.500000 T 0.500000 0.866025 T -0.437114E-07 1.00000 T -0.500000 0.866025 T -0.866025 0.500000 T -1.00000 -0.874228E-07 T -0.866025 -0.500000 T -0.500000 -0.866025 T 0.119249E-07 -1.00000 T 0.500000 -0.866025 F 0.866026 -0.500000 F 1.00000 0.174846E-06 T Angle = 6.27319 Vertex A : ( 1.00000 , 0.00000 ) Vertex B : ( 0.00000 , 0.00000 ) Vertex C : ( 1.00000 , -0.100000E-01) X Y Inside? 1.00000 0.00000 T 0.866025 0.500000 T 0.500000 0.866025 T -0.437114E-07 1.00000 T -0.500000 0.866025 T -0.866025 0.500000 T -1.00000 -0.874228E-07 T -0.866025 -0.500000 T -0.500000 -0.866025 T 0.119249E-07 -1.00000 T 0.500000 -0.866025 T 0.866026 -0.500000 T 1.00000 0.174846E-06 T TEST02 ANGLE_DEG_2D computes an angle; ANGLEI_DEG_2D computes an interior angle; ANGLE_RAD_ND computes an angle. X, Y, Theta, atan2(y, x), ANGLE_RAD_ND, ANGLE_DEG_2D, ANGLEI_DEG_2D 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.866 0.500 30.000 30.000 0.524 30.000 30.000 0.500 0.866 60.000 60.000 1.047 60.000 60.000 0.000 1.000 90.000 90.000 1.571 90.000 90.000 -0.500 0.866 120.000 120.000 2.094 120.000 120.000 -0.866 0.500 150.000 150.000 2.618 150.000 150.000 -1.000 0.000 180.000 -180.000 3.142 180.000 180.000 -0.866 -0.500 210.000 -150.000 2.618 210.000 150.000 -0.500 -0.866 240.000 -120.000 2.094 240.000 120.000 0.000 -1.000 270.000 -90.000 1.571 270.000 90.000 0.500 -0.866 300.000 -60.000 1.047 300.000 60.000 0.866 -0.500 330.000 -30.000 0.524 330.000 30.000 1.000 0.000 360.000 0.000 0.000 0.000 0.000 TEST03 ANGLE_RAD_3D computes an angle; X, Y, Z, ANGLE_RAD_3D, (Degrees) 1.000 0.000 0.000 1.571 90.00 1.000 2.000 3.000 0.6405 36.70 0.000 0.000 1.000 0.000 0.000 TEST032 ARC_COSINE computes an angle with a given cosine; X, ARC_COSINE(X), (Degrees) 5.000 0.000 0.000 1.200 0.000 0.000 1.000 0.000 0.000 0.9000 0.4510 25.84 0.5000 1.047 60.00 0.000 1.571 90.00 -0.9000 2.691 154.2 -1.000 3.142 180.0 -1.010 3.142 180.0 TEST034 ATAN4 computes an angle with a given tangent. X, Y, ATAN(Y/X), ATAN2(Y,X), ATAN4(Y,X) 1.000 0.000 0.000 0.000 0.000 1.000 1.000 0.7854 0.7854 0.7854 1.000 2.000 1.107 1.107 1.107 1.000 0.000 0.000 0.000 0.000 1.000 -1.000 -0.7854 -0.7854 5.498 -1.000 -1.000 0.7854 -2.356 3.927 -1.000 -1.000 0.7854 -2.356 3.927 0.000 -1.000 -1.571 -1.571 4.712 Repeat, but display answers in degrees. 1.000 0.000 0.000 0.000 0.000 1.000 1.000 45.00 45.00 45.00 1.000 2.000 63.43 63.43 63.43 1.000 0.000 0.000 0.000 0.000 1.000 -1.000 -45.00 -45.00 315.0 -1.000 -1.000 45.00 -135.0 225.0 -1.000 -1.000 45.00 -135.0 225.0 0.000 -1.000 -90.00 -90.00 270.0 TEST0325 For the unit ball in 2 dimensions (the disk): BALL_UNIT_SAMPLE_2D samples; A few sample values: -0.4743 -0.7020 -0.3218 0.1080 -0.5319 -0.3893 0.0504 0.8732 -0.1876 0.6993 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N increases. Average: -0.0048 -0.0122 Now average the distance of the points from the center, which should be 1/sqrt(2) = 0.7071 Average: 0.6824 Now average the angle THETA, which should be PI. Average: 3.2279 TEST0326 For the unit ball in 3 dimensions: BALL_UNIT_SAMPLE_3D samples; A few sample values: -0.7620 0.1547 -0.0066 -0.2213 0.2185 0.3049 0.2385 0.0507 -0.3121 0.3531 -0.4585 0.2003 -0.1250 0.1634 -0.5759 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N increases. Average: 0.0031 -0.0011 0.0089 Now average the distance of the points from the center, which should be the 1/2**(1/n) = 0.7937 Average: 0.7405 Now average the angle THETA, which should be PI. Average: 3.1627 Now average the angle PHI, which should be PI/2. Average: 1.5894 TEST04 BASIS_MAP_3D computes the linear transform A which maps vectors U1, U2 and U3 to vectors V1, V2 and V3. The column vectors U1, U2, U3: 1.00000 0.00000 1.00000 2.00000 0.00000 0.00000 3.00000 1.00000 2.00000 The column vectors V1, V2, V3: 14.0000 3.00000 7.00000 4.00000 1.00000 3.00000 4.00000 0.00000 2.00000 The transformation matrix A: 1.00000 2.00000 3.00000 1.00000 0.00000 1.00000 2.00000 1.00000 0.00000 The product matrix A * [ U1 | U2 | U3 ]: 14.0000 3.00000 7.00000 4.00000 1.00000 3.00000 4.00000 0.00000 2.00000 TEST044 BOX_CLIP_LINE_2D clips a line with respect to a box. The lower left box corner is: -10.0000 10.0000 The upper right box corner is: 10.0000 20.0000 We list the points (X1,Y1) and (X2,Y2), and then the clipped values. 1.0000 2.0000 8.0000 16.0000 5.0000 10.0000 -3.0000 12.0000 5.0000 12.0000 Line is inside the box. -20.0000 20.0000 7.0000 20.0000 -10.0000 20.0000 -20.0000 40.0000 0.0000 0.0000 -10.0000 20.0000 -5.0000 10.0000 10.0000 40.0000 20.0000 30.0000 Line is outside the box. TEST045 For a box with coordinate line sides in 2D, BOX_RAY_INT_2D computes the intersection of a shape and a ray whose origin is within the shape. Lower left box corner: 0.00000 0.00000 Upper right box corner: 5.00000 3.00000 Origin: 3.0000 1.0000 Point 2: 5.0000 5.0000 Intersection: 4.0000 3.0000 Correct: 4.0000 3.0000 Origin: 4.0000 1.0000 Point 2: 3.0000 1.0000 Intersection: 0.0000 1.0000 Correct: 0.0000 1.0000 Origin: 3.0000 1.0000 Point 2: 4.0000 2.0000 Intersection: 5.0000 3.0000 Correct: 5.0000 3.0000 TEST05 PARAPP_POINT_DIST_3D computes the distance from a point to a box (parallelipiped) in 3D. The 4 box corners that are specified: 1 0.00 0.00 0.00 2 2.00 0.00 0.00 3 0.00 8.00 0.00 4 0.00 0.00 1.00 I X,Y,Z, Distance to box 1 1.00 4.00 0.50 1.11803 2 1.00 0.00 0.50 0.00000 3 0.00 4.00 1.00 0.00000 4 2.00 8.00 1.00 0.00000 5 -0.50 4.00 0.50 0.707107 6 1.00 -1.00 -1.00 1.41421 7 3.00 9.00 2.00 1.73205 TEST015 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 Theta Sector Triangle Lune 1.00000000 0.00000000 0.00000000 0.00000000 0.00000000 1.00000000 0.52359879 0.26179940 0.25000000 0.01179940 1.00000000 1.04719758 0.52359879 0.43301269 0.09058610 1.00000000 1.57079637 0.78539819 0.50000000 0.28539819 1.00000000 2.09439516 1.04719758 0.43301266 0.61418492 1.00000000 2.61799407 1.30899704 0.24999991 1.05899715 1.00000000 3.14159274 1.57079637 -0.00000004 1.57079637 1.00000000 3.66519165 1.83259583 -0.25000009 2.08259583 1.00000000 4.18879032 2.09439516 -0.43301272 2.52740788 1.00000000 4.71238899 2.35619450 -0.50000000 2.85619450 1.00000000 5.23598814 2.61799407 -0.43301260 3.05100679 1.00000000 5.75958681 2.87979341 -0.24999988 3.12979317 1.00000000 6.28318548 3.14159274 0.00000009 3.14159274 TEST016 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. Our circle is of radius 2.00000 with center 5.00000 3.00000 The first angle of our lune and sector is always 0. Lune Sector THETA2 X Y X Y 0.00000000 7.00000000 3.00000000 6.33333349 3.00000000 0.52359879 6.69667339 3.97957492 6.14155531 3.65907717 1.04719758 5.91993523 4.59337425 5.63661957 4.10265779 1.57079637 5.00000000 4.65174294 5.00000000 4.20042181 2.09439516 4.29498005 4.22113037 4.44867086 3.95492959 2.61799407 4.01733398 3.56734228 4.14793158 3.49194193 3.14159274 4.15117359 3.00000000 4.15117359 3.00000000 3.66519165 4.50031567 2.71150708 4.39137983 2.64861274 4.18879032 4.82867336 2.70325327 4.72433567 2.52253532 4.71238899 5.00000000 2.83495355 5.00000000 2.59985948 5.23598814 5.02731323 2.95269179 5.12732410 2.77946854 5.75958681 5.00639629 2.99630690 5.10377789 2.94008398 6.28318548 5.00000000 3.00000000 5.00000000 3.00000000 TEST06 CIRCLE_EXP_CONTAINS_POINT_2D determines if a point lies inside a circle. Point 1 : ( 4.00000 , 2.00000 ) Point 2 : ( 1.00000 , 5.00000 ) Point 3 : ( -2.00000 , 2.00000 ) Point 4 : ( 2.00000 , 3.00000 ) INSIDE = -1 The point is inside the circle. X1,Y1 = 4.00000 2.00000 X2,Y2 = 1.00000 5.00000 X3,Y3 = -2.00000 2.00000 X4,Y4 = 1.00000 -1.00000 INSIDE = 0 The point is on the circle. X1,Y1 = 4.00000 2.00000 X2,Y2 = 1.00000 5.00000 X3,Y3 = -2.00000 2.00000 X4,Y4 = 4.00000 6.00000 INSIDE = 1 The point is outside the circle TEST07 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. TRIANGLE_DIAMETER_2D computes the diameter of the SMALLEST circle around the triangle. X1, Y1 = 4.00000 2.00000 X2, Y2 = 1.00000 5.00000 X3, Y3 = -2.00000 2.00000 #1 R, XC, YC = 3.00000 1.00000 2.00000 #2 R, XC, YC = 3.00000 1.00000 2.00000 #3 D/2 = 3.00000 X1, Y1 = 4.00000 2.00000 X2, Y2 = 5.00000 4.00000 X3, Y3 = 6.00000 6.00000 #1 R, XC, YC = -1.00000 0.00000 0.00000 #2 R, XC, YC = -1.00000 0.00000 0.00000 #3 D/2 = 2.23607 X1, Y1 = 4.00000 2.00000 X2, Y2 = 1.00000 5.00000 X3, Y3 = 4.00000 2.00000 #1 R, XC, YC = -1.00000 0.00000 0.00000 #2 R, XC, YC = -1.00000 0.00000 0.00000 #3 D/2 = 2.12132 TEST08 CIRCLE_IMP_POINTS_2D gets points on a circle; POLYGON_AREA_2D finds the area of a polygon. The circle will have center 5.00000 -2.00000 and radius 2.00000 and hence area = 12.5664 Sample results: 1 7.00000 -2.00000 2 6.41421 -0.585786 3 5.00000 0.00000 4 3.58579 -0.585786 5 3.00000 -2.00000 6 3.58579 -3.41421 7 5.00000 -4.00000 8 6.41421 -3.41421 For any N, the sampled points define a polygon whose area approximates the circle area. N Area 3 5.19615 4 8.00000 5 9.51056 6 10.3923 7 10.9456 8 11.3137 9 11.5702 10 11.7557 11 11.8941 12 12.0000 13 12.0828 14 12.1487 15 12.2021 16 12.2459 17 12.2822 18 12.3127 19 12.3386 20 12.3607 21 12.3797 22 12.3962 23 12.4107 24 12.4233 TEST09 CIRCLE_IMP_POINTS_ARC_2D returns points on a circular arc. The circle will have center 5.00000 -2.00000 and radius 2.00000 The arc extends from THETA1 = 1.57080 to THETA2 = 4.71239 Sample results: 1 5.00000 0.00000 2 3.58579 -0.585786 3 3.00000 -2.00000 4 3.58579 -3.41421 5 5.00000 -4.00000 TEST095 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 will always have center 0.00000 0.00000 and radius 5.00000 The second circle will have center 5.00000 5.00000 and radius 0.500000 The circles do not intersect. The second circle will have center 7.07107 7.07107 and radius 5.00000 The circles intersect at one point: X Y Dist 1 Dist 2 3.5355 3.5355 0.0000 0.0000 The second circle will have center 4.00000 0.00000 and radius 3.00000 The circles intersect at two points: X Y Dist 1 Dist 2 4.0000 3.0000 0.0000 0.0000 4.0000 -3.0000 0.0000 0.0000 The second circle will have center 6.00000 0.00000 and radius 3.00000 The circles intersect at two points: X Y Dist 1 Dist 2 4.3333 2.4944 0.0020 0.0010 4.3333 -2.4944 0.0020 0.0010 The second circle will have center 0.00000 0.00000 and radius 5.00000 The circles coincide (infinite intersection). TEST10 CORPL_2D Compute (X4,Y4) and (X5,Y5), normal to line through (X1,Y1) and (X2,Y2), and line through (X2,Y2) and (X3,Y3), and DIST units from (X2,Y2). Point 1: 0.00000 0.00000 Point 2: 3.00000 0.00000 Point 3: 4.00000 2.00000 DIST = 1.00000 Point 4: 2.38197 1.00000 Point 5: 3.61803 -1.00000 Point 1: 0.00000 0.00000 Point 2: 3.00000 0.00000 Point 3: 2.00000 -2.00000 DIST = 1.00000 Point 4: 1.38197 -1.00000 Point 5: 4.61803 1.00000 Point 1: 3.00000 0.00000 Point 2: 3.00000 0.00000 Point 3: 2.00000 -2.00000 DIST = 1.00000 Point 4: 2.10557 0.447214 Point 5: 3.89443 -0.447214 TEST11 CUBE_SHAPE_3D returns shape information for the cube; DUAL_SHAPE_3D finds the dual of a regular polygon; OCTAHEDRON_SHAPE_3D returns shape information for the octahedron; SHAPE_PRINT_3D prints 3D shape information. polygon; THE CUBE: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 8 Vertex coordinates are: 1 -0.5774 -0.5774 -0.5774 2 0.5774 -0.5774 -0.5774 3 0.5774 0.5774 -0.5774 4 -0.5774 0.5774 -0.5774 5 -0.5774 -0.5774 0.5774 6 0.5774 -0.5774 0.5774 7 0.5774 0.5774 0.5774 8 -0.5774 0.5774 0.5774 The number of faces is 6 The order of each face is 4 The vertices in each face are: 1 1 4 3 2 2 1 2 6 5 3 2 3 7 6 4 3 4 8 7 5 1 5 8 4 6 5 6 7 8 THE OCTAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 6 Vertex coordinates are: 1 0.0000 0.0000 -1.0000 2 0.0000 -1.0000 0.0000 3 1.0000 0.0000 0.0000 4 0.0000 1.0000 0.0000 5 0.0000 -1.0000 0.0000 6 0.0000 0.0000 1.0000 The number of faces is 8 The order of each face is 3 The vertices in each face are: 1 1 3 2 2 1 4 3 3 1 5 4 4 1 2 5 5 2 3 6 6 3 4 6 7 4 5 6 8 5 2 6 DUAL OF THE CUBE: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 6 Vertex coordinates are: 1 0.0000 0.0000 -1.0000 2 0.0000 -1.0000 0.0000 3 1.0000 0.0000 0.0000 4 0.0000 1.0000 0.0000 5 -1.0000 0.0000 0.0000 6 0.0000 0.0000 1.0000 The number of faces is 8 The order of each face is 3 The vertices in each face are: 1 1 2 5 2 1 3 2 3 1 4 3 4 1 5 4 5 2 6 5 6 2 3 6 7 3 4 6 8 4 5 6 DUAL OF THE DUAL OF THE CUBE: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 8 Vertex coordinates are: 1 -0.5774 -0.5774 -0.5774 2 0.5774 -0.5774 -0.5774 3 0.5774 0.5774 -0.5774 4 -0.5774 0.5774 -0.5774 5 -0.5774 -0.5774 0.5774 6 0.5774 -0.5774 0.5774 7 0.5774 0.5774 0.5774 8 -0.5774 0.5774 0.5774 The number of faces is 6 The order of each face is 4 The vertices in each face are: 1 1 4 3 2 2 1 2 6 5 3 2 3 7 6 4 3 4 8 7 5 1 5 8 4 6 5 6 7 8 TEST12 DIRECTION_PERT_3D perturbs a direction vector. Base vector: 1.0000 0.0000 0.0000 Using Sigma = 0.990000 0.9612 -0.2154 0.1725 0.9989 -0.0364 -0.0281 0.9800 0.1966 -0.0292 0.9943 0.0607 -0.0881 0.9982 -0.0576 -0.0190 0.9976 -0.0120 0.0688 0.9999 0.0139 -0.0096 0.9913 -0.1074 -0.0763 0.9906 -0.0409 0.1305 0.9987 -0.0442 -0.0256 0.9594 -0.2746 -0.0651 0.9984 0.0409 0.0402 0.9790 -0.1094 0.1722 0.9862 -0.1342 -0.0974 0.9872 -0.1441 0.0689 0.9597 -0.1141 0.2570 0.9859 -0.0248 0.1652 0.9704 -0.1297 -0.2038 0.9643 -0.0810 -0.2522 0.9883 -0.0248 -0.1504 Using Sigma = 0.500000 -0.3148 0.8392 -0.4435 0.0350 0.6939 -0.7192 0.4128 0.4521 -0.7907 -0.5259 0.2494 -0.8132 0.3796 0.8790 0.2886 0.1377 -0.9855 -0.0988 -0.0260 0.0780 0.9966 0.8594 -0.4409 0.2591 0.4427 0.7922 -0.4201 0.9974 0.0511 0.0514 0.9564 -0.0944 -0.2763 0.4972 0.8401 -0.2168 0.7650 0.3215 0.5581 0.8505 -0.4363 -0.2938 -0.0364 0.1596 0.9865 0.3002 0.2739 -0.9137 0.7928 0.5388 0.2849 0.9915 0.0625 0.1145 0.9429 -0.0591 -0.3278 0.9610 -0.2516 -0.1146 Using Sigma = 0.100000 -0.3794 -0.9235 -0.0570 -0.0297 -0.7257 -0.6873 -0.6214 0.7173 -0.3151 -0.0895 -0.5269 -0.8452 0.8247 0.5411 0.1643 -0.2147 -0.0943 0.9721 -0.5857 0.0125 0.8104 -0.9474 0.2313 -0.2211 -0.1088 0.7251 -0.6800 -0.4390 0.6669 0.6021 0.2596 -0.9612 -0.0936 0.7156 -0.6944 0.0761 0.7133 -0.1795 0.6775 -0.6549 -0.7158 -0.2424 -0.5078 0.1056 -0.8550 0.1401 0.6406 0.7550 0.0606 0.5195 -0.8523 0.6392 -0.6799 0.3594 -0.6173 0.5931 -0.5169 -0.5958 0.2527 0.7624 TEST13 DIRECTION_RANDOM_3D picks a random direction vector. -0.9272 0.1015 -0.3605 -0.1389 -0.5239 0.8404 0.6013 -0.7651 -0.2304 0.9316 -0.0202 0.3629 -0.9868 0.1452 0.0714 0.5379 -0.5691 0.6219 -0.3655 -0.6257 -0.6891 0.3726 0.7841 -0.4963 -0.5793 0.7261 -0.3705 0.8491 0.3639 0.3830 TEST14 DIRECTION_RANDOM_ND picks a random direction vector. 0.1124 -0.7147 0.2288 0.6513 -0.2568 -0.6852 -0.0317 -0.6808 0.7361 -0.4708 0.4027 -0.2726 0.2583 0.3743 -0.7213 -0.5224 -0.0082 0.4235 0.2038 0.8826 -0.6338 0.2484 -0.7139 -0.1643 -0.7475 0.5759 -0.1947 -0.2678 -0.6555 0.6562 0.3016 -0.2206 0.3271 -0.7658 0.5283 -0.1657 0.7502 0.6455 0.1361 -0.0452 TEST15 DODEC_SHAPE_3D returns shape information for the dodecahedron; DUAL_SHAPE_3D finds the dual of a regular polygon; ICOS_SHAPE_3D returns shape information for the icosahedron; SHAPE_PRINT_3D prints 3D shape information. polygon. THE DODECAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 20 Vertex coordinates are: 1 0.5774 0.5774 0.5774 2 0.5774 0.5774 -0.5774 3 0.5774 -0.5774 0.5774 4 0.5774 -0.5774 -0.5774 5 -0.5774 0.5774 0.5774 6 -0.5774 0.5774 -0.5774 7 -0.5774 -0.5774 0.5774 8 -0.5774 -0.5774 -0.5774 9 0.3568 0.9342 0.0000 10 -0.3568 0.9342 0.0000 11 0.3568 -0.9342 0.0000 12 -0.3568 -0.9342 0.0000 13 0.9342 0.0000 0.3568 14 0.9342 0.0000 -0.3568 15 -0.9342 0.0000 0.3568 16 -0.9342 0.0000 -0.3568 17 0.0000 0.3568 0.9342 18 0.0000 -0.3568 0.9342 19 0.0000 0.3568 -0.9342 20 0.0000 -0.3568 -0.9342 The number of faces is 12 The order of each face is 5 The vertices in each face are: 1 2 9 1 13 14 2 5 10 6 16 15 3 3 11 4 14 13 4 8 12 7 15 16 5 3 13 1 17 18 6 2 14 4 20 19 7 5 15 7 18 17 8 8 16 6 19 20 9 5 17 1 9 10 10 3 18 7 12 11 11 2 19 6 10 9 12 8 20 4 11 12 THE ICOSAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 12 Vertex coordinates are: 1 0.8507 0.5257 0.0000 2 -0.8507 0.5257 0.0000 3 0.8507 -0.5257 0.0000 4 -0.8507 -0.5257 0.0000 5 0.5257 0.0000 0.8507 6 0.5257 0.0000 -0.8507 7 -0.5257 0.0000 0.8507 8 -0.5257 0.0000 -0.8507 9 0.0000 0.8507 0.5257 10 0.0000 -0.8507 0.5257 11 0.0000 0.8507 -0.5257 12 0.0000 -0.8507 -0.5257 The number of faces is 20 The order of each face is 3 The vertices in each face are: 1 1 9 5 2 1 6 11 3 3 5 10 4 3 12 6 5 2 7 9 6 2 11 8 7 4 10 7 8 4 8 12 9 1 11 9 10 2 9 11 11 3 10 12 12 4 12 10 13 5 3 1 14 6 1 3 15 7 2 4 16 8 4 2 17 9 7 5 18 10 5 7 19 11 6 8 20 12 8 6 DUAL OF THE DODECAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 12 Vertex coordinates are: 1 0.8507 0.5257 0.0000 2 -0.8507 0.5257 0.0000 3 0.8507 -0.5257 0.0000 4 -0.8507 -0.5257 0.0000 5 0.5257 0.0000 0.8507 6 0.5257 0.0000 -0.8507 7 -0.5257 0.0000 0.8507 8 -0.5257 0.0000 -0.8507 9 0.0000 0.8507 0.5257 10 0.0000 -0.8507 0.5257 11 0.0000 0.8507 -0.5257 12 0.0000 -0.8507 -0.5257 The number of faces is 20 The order of each face is 3 The vertices in each face are: 1 1 9 5 2 1 6 11 3 3 5 10 4 3 12 6 5 2 7 9 6 2 11 8 7 4 10 7 8 4 8 12 9 1 11 9 10 2 9 11 11 3 10 12 12 4 12 10 13 1 5 3 14 1 3 6 15 2 4 7 16 2 8 4 17 5 9 7 18 5 7 10 19 6 8 11 20 6 12 8 DUAL OF THE DUAL OF THE DODECAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 20 Vertex coordinates are: 1 0.5774 0.5774 0.5774 2 0.5774 0.5774 -0.5774 3 0.5774 -0.5774 0.5774 4 0.5774 -0.5774 -0.5774 5 -0.5774 0.5774 0.5774 6 -0.5774 0.5774 -0.5774 7 -0.5774 -0.5774 0.5774 8 -0.5774 -0.5774 -0.5774 9 0.3568 0.9342 0.0000 10 -0.3568 0.9342 0.0000 11 0.3568 -0.9342 0.0000 12 -0.3568 -0.9342 0.0000 13 0.9342 0.0000 0.3568 14 0.9342 0.0000 -0.3568 15 -0.9342 0.0000 0.3568 16 -0.9342 0.0000 -0.3568 17 0.0000 0.3568 0.9342 18 0.0000 -0.3568 0.9342 19 0.0000 0.3568 -0.9342 20 0.0000 -0.3568 -0.9342 The number of faces is 12 The order of each face is 5 The vertices in each face are: 1 1 13 14 2 9 2 5 10 6 16 15 3 3 11 4 14 13 4 7 15 16 8 12 5 1 17 18 3 13 6 2 14 4 20 19 7 5 15 7 18 17 8 6 19 20 8 16 9 1 9 10 5 17 10 3 18 7 12 11 11 2 19 6 10 9 12 4 11 12 8 20 TEST16 DUAL_SHAPE_3D finds the dual of a regular polygon; SHAPE_PRINT_3D prints 3D shape information. polygon; TETRA_SHAPE_3D returns shape information for the tetrahedron. THE TETRAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 4 Vertex coordinates are: 1 0.0000 0.9428 -0.3333 2 -0.8165 -0.4714 -0.3333 3 0.8165 -0.4714 -0.3333 4 0.0000 0.0000 1.0000 The number of faces is 4 The order of each face is 3 The vertices in each face are: 1 1 3 2 2 1 2 4 3 1 4 3 4 2 3 4 DUAL OF THE TETRAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 4 Vertex coordinates are: 1 0.0000 0.0000 -1.0000 2 -0.8165 0.4714 0.3333 3 0.8165 0.4714 0.3333 4 0.0000 -0.9428 0.3333 The number of faces is 4 The order of each face is 3 The vertices in each face are: 1 1 2 3 2 1 4 2 3 1 3 4 4 2 4 3 DUAL OF THE DUAL OF THE TETRAHEDRON: SHAPE_PRINT_3D Information about a regular polyhedron. The number of vertices is 4 Vertex coordinates are: 1 0.0000 0.9428 -0.3333 2 -0.8165 -0.4714 -0.3333 3 0.8165 -0.4714 -0.3333 4 0.0000 0.0000 1.0000 The number of faces is 4 The order of each face is 3 The vertices in each face are: 1 1 3 2 2 1 2 4 3 1 4 3 4 2 3 4 TEST17 ELLIPSE_POINTS_2D returns points on an ellipse; ELLIPSE_AREA_2D returns the area of an ellipse; POLYGON_1_2D finds the area of a polygon. The ellipse will have center 5.00000 -2.00000 radii R1 = 3.00000 R2 = 1.00000 and angle PSI = 0.523599 and area = 9.42478 Sample points: 1 7.59808 -0.500000 2 7.20897 -0.282767 3 6.48356 -0.326967 4 5.53230 -0.625872 5 4.50000 -1.13397 6 3.54382 -1.77392 7 2.80933 -2.44829 8 2.40835 -3.05441 9 2.40192 -3.50000 10 2.79103 -3.71723 11 3.51644 -3.67303 12 4.46770 -3.37413 13 5.50000 -2.86603 14 6.45618 -2.22608 15 7.19067 -1.55171 16 7.59165 -0.945594 For any N, the sampled points define a polygon whose area approximates the ellipse area. N Area 3 3.89711 4 6.00000 5 7.13292 6 7.79423 7 8.20923 8 8.48528 9 8.67763 10 8.81678 11 8.92057 12 9.00000 13 9.06210 14 9.11156 15 9.15157 16 9.18440 17 9.21166 18 9.23454 19 9.25393 20 9.27051 21 9.28479 22 9.29717 23 9.30799 24 9.31749 TEST18 ELLIPSE_POINTS_ARC_2D returns points on an elliptical arc. The ellipse will have center 5.00000 -2.00000 radii R1 = 3.00000 R2 = 1.00000 and angle PSI = 0.523599 The arc extends from THETA1 = 1.57080 to THETA2 = 6.28319 Sample points: 1 4.50000 -1.13397 2 3.54382 -1.77392 3 2.80933 -2.44829 4 2.40835 -3.05441 5 2.40192 -3.50000 6 2.79103 -3.71723 7 3.51644 -3.67303 8 4.46770 -3.37413 9 5.50000 -2.86603 10 6.45618 -2.22608 11 7.19067 -1.55171 12 7.59165 -0.945594 13 7.59808 -0.500000 TEST1855 HALFPLANE_CONTAINS_POINT_2D determines whether a halfplane bounded by (XA,YA):(XB,YB) contains the point (X,Y). (XA,YA)= 0.00000 0.00000 (XB,YB)= 2.00000 0.00000 (X,Y) = 1.00000 1.00000 Contains? = T Correct = T (XA,YA)= 0.00000 0.00000 (XB,YB)= 2.00000 0.00000 (X,Y) = 1.00000 -1.00000 Contains? = F Correct = F (XA,YA)= -5.00000 -5.00000 (XB,YB)= 10.0000 10.0000 (X,Y) = -1.00000 1.00000 Contains? = T Correct = T (XA,YA)= 3.00000 150.000 (XB,YB)= 1.00000 50.0000 (X,Y) = 2.00000 200.000 Contains? = F Correct = F TEST19 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.00000 -2.00000 -3.00000 6.00000 Case 1 Triangle vertices: 0.00000 0.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 0.00000 -2.00000 Number of intersection points is 0 Case 2 Triangle vertices: -6.00000 0.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 0.00000 -2.00000 Number of intersection points is 1 1 -6.00000 0.00000 0.00000 Case 3 Triangle vertices: 0.00000 0.00000 0.00000 0.00000 3.00000 0.00000 0.00000 0.00000 2.00000 Number of intersection points is 2 1 0.00000 3.00000 0.00000 2 0.00000 0.00000 2.00000 Case 4 Triangle vertices: -6.00000 0.00000 0.00000 0.00000 4.00000 0.00000 0.00000 0.00000 3.00000 Number of intersection points is 3 1 -6.00000 0.00000 0.00000 2 0.00000 4.00000 0.00000 3 0.00000 0.00000 3.00000 Case 5 Triangle vertices: -8.00000 0.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 0.00000 -2.00000 Number of intersection points is 3 1 -8.00000 0.00000 0.00000 2 -6.40000 -0.200000 0.00000 3 -6.85714 0.00000 -0.285714 Case 6 Triangle vertices: 0.00000 0.00000 0.00000 0.00000 4.00000 0.00000 0.00000 0.00000 4.00000 Number of intersection points is 4 1 0.00000 3.00000 0.00000 2 0.00000 4.00000 0.00000 3 0.00000 0.00000 4.00000 4 0.00000 0.00000 2.00000 TEST20 HALFSPACE_NORM_TRIANGLE_INT_3D finds intersection points of a normal form halfspace and a triangle. A point on the plane is -6.00000 0.00000 0.00000 A normal vector to the plane is 2.00000 -4.00000 -6.00000 Case 1 Triangle vertices: 0.00000 0.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 0.00000 -2.00000 Number of intersection points is 0 Case 2 Triangle vertices: -6.00000 0.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 0.00000 -2.00000 Number of intersection points is 1 1 -6.00000 0.00000 0.00000 Case 3 Triangle vertices: 0.00000 0.00000 0.00000 0.00000 3.00000 0.00000 0.00000 0.00000 2.00000 Number of intersection points is 2 1 0.00000 3.00000 0.00000 2 0.00000 0.00000 2.00000 Case 4 Triangle vertices: -6.00000 0.00000 0.00000 0.00000 4.00000 0.00000 0.00000 0.00000 3.00000 Number of intersection points is 3 1 -6.00000 0.00000 0.00000 2 0.00000 4.00000 0.00000 3 0.00000 0.00000 3.00000 Case 5 Triangle vertices: -8.00000 0.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 0.00000 -2.00000 Number of intersection points is 3 1 -8.00000 0.00000 0.00000 2 -6.40000 -0.200000 0.00000 3 -6.85714 0.00000 -0.285714 Case 6 Triangle vertices: 0.00000 0.00000 0.00000 0.00000 4.00000 0.00000 0.00000 0.00000 4.00000 Number of intersection points is 4 1 0.00000 3.00000 0.00000 2 0.00000 4.00000 0.00000 3 0.00000 0.00000 4.00000 4 0.00000 0.00000 2.00000 TEST2055 HAVERSINE computes the haversine of an angle. Degrees Radians Haversine 0.0000 0.0000 0.00000 30.0000 0.5236 0.669873E-01 60.0000 1.0472 0.250000 90.0000 1.5708 0.500000 120.0000 2.0944 0.750000 150.0000 2.6180 0.933013 180.0000 3.1416 1.00000 210.0000 3.6652 0.933013 240.0000 4.1888 0.750000 270.0000 4.7124 0.500000 300.0000 5.2360 0.250000 330.0000 5.7596 0.669872E-01 360.0000 6.2832 0.00000 TEST21 HEXAGON_SHAPE_2D: points on a unit hexagon. Angle X Y -10.0000 0.907604 -0.160035 0.00000 1.00000 0.00000 10.0000 0.907604 0.160035 20.0000 0.826352 0.300767 30.0000 0.750000 0.433013 40.0000 0.673648 0.565258 50.0000 0.592396 0.705990 60.0000 0.500000 0.866025 70.0000 0.315207 0.866025 80.0000 0.152704 0.866025 90.0000 -0.378552E-07 0.866025 100.000 -0.152704 0.866025 110.000 -0.315207 0.866025 120.000 -0.500000 0.866025 130.000 -0.592396 0.705990 140.000 -0.673648 0.565258 150.000 -0.750000 0.433013 160.000 -0.826352 0.300767 170.000 -0.907604 0.160035 180.000 -1.00000 -0.874228E-07 190.000 -0.907604 -0.160035 200.000 -0.826352 -0.300768 210.000 -0.750000 -0.433013 220.000 -0.673648 -0.565258 230.000 -0.592396 -0.705991 240.000 -0.500000 -0.866026 250.000 -0.315207 -0.866025 260.000 -0.152704 -0.866025 270.000 0.103272E-07 -0.866025 280.000 0.152704 -0.866025 290.000 0.315208 -0.866025 300.000 0.500000 -0.866025 310.000 0.592396 -0.705991 320.000 0.673648 -0.565258 330.000 0.750000 -0.433013 340.000 0.826352 -0.300768 350.000 0.907604 -0.160035 360.000 1.00000 0.00000 370.000 0.907604 0.160035 TEST2155 LINE_EXP_PERP_2D is given a point P and a line L, and finds a point Q on the line L, so that PQ is perpendicular to L. Line point 1 = 1.00000 3.00000 Line point 2 = 4.00000 0.00000 Point P = 0.00000 0.00000 Point Q = 2.00000 2.00000 Point P = 5.00000 -1.00000 Point Q = 5.00000 -1.00000 Point P = 5.00000 3.00000 Point Q = 3.00000 1.00000 TEST22 LINE_EXP_POINT_NEAR_2D finds the point on a line nearest in point in 2D. Line point 1 = 1.00000 3.00000 Line point 2 = 4.00000 0.00000 Point = 0.00000 0.00000 Nearest point on line = 2.00000 2.00000 Distance = 2.82843 Relative line position T = 0.333333 Point = 5.00000 -1.00000 Nearest point on line = 5.00000 -1.00000 Distance = 0.00000 Relative line position T = 1.33333 Point = 5.00000 3.00000 Nearest point on line = 3.00000 1.00000 Distance = 2.82843 Relative line position T = 0.666667 TEST2235 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.0000 6.0000 2.0000 5.0000 3.0000 6.1279 0.0000 5.0000 2.0000 5.0000 3.0000 5.1995 0.0000 4.0000 2.0000 5.0000 3.0000 4.2710 TEST2255 LINE_SEG_CONTAINS_POINT_1D determines if a point lies within a line segment in 1D. X1 X2 X3 U 2.00 6.00 3.00 0.250000 10.00 -10.00 7.50 0.125000 8.00 10.00 20.00 6.00000 88.00 88.00 5.00 -0.340282E+39 TEST23 LINE_SEG_POINT_NEAR_3D computes the nearest point on a line segment, to a given point, in 3D. Case, T, Distance, XN, YN, ZN. 1 1.0000 5.0000 8.0000 6.0000 0.0000 2 0.3333 1.0000 4.0000 4.0000 0.0000 3 0.6667 0.0000 6.0000 5.0000 0.0000 TEST24 LINES_EXP_ANGLE_3D finds the angle between two explicit lines in 3D; LINES_EXP_DIST_3D finds the distance between two explicit lines in 3D. Angle between lines is 1.89255 radians. Distance is 3.00000 Angle between lines is 1.57080 radians. Distance is 0.00000 TEST25 LINES_EXP_INT_2D finds intersections of two explicit lines in 2D. X1,Y1 0.00000 2.00000 X2,Y2 4.00000 0.00000 X3,Y3 0.00000 -1.00000 X4,Y4 1.00000 0.00000 Intersection at 2.00000 1.00000 X1,Y1 0.00000 2.00000 X2,Y2 4.00000 0.00000 X3,Y3 0.00000 0.250000 X4,Y4 0.500000 0.00000 Lines are parallel, no intersection. X1,Y1 0.00000 2.00000 X2,Y2 4.00000 0.00000 X3,Y3 0.00000 2.00000 X4,Y4 4.00000 0.00000 Lines are coincident. TEST255 LINES_IMP_DIST_3D finds the distance between two implicit lines in 2D. A1 B1 C1 A2 B2 C2 DIST 4.0000 -1.0000 3.0000 4.0000 -1.0000 12.0000 2.1828 2.0000 -1.0000 0.0000 4.0000 -2.0000 6.0000 1.3416 1.0000 2.0000 2.0000 2.0000 3.0000 1.0000 0.0000 TEST26 For two lines written in implicit form: LINES_IMP_ANGLE_2D finds the angle; LINES_IMP_INT_2D finds the intersection. Line 1 coefficients: 1.00000 2.00000 -4.00000 Line 2 coefficients: 1.00000 -1.00000 -1.00000 Angle between lines is 108.435 Intersection at 2.00000 1.00000 Line 1 coefficients: 1.00000 2.00000 -4.00000 Line 2 coefficients: 2.00000 4.00000 -1.00000 Angle between lines is 0.00000 Lines are parallel, no intersection. Line 1 coefficients: 1.00000 2.00000 -4.00000 Line 2 coefficients: -3.00000 -6.00000 12.0000 Angle between lines is 180.000 Lines are coincident. TEST27 LINES_SEG_DIST_2D computes the distance between line segments in 2D. Same slope, different intercepts. Distance = 2.68328 Same slope, same intercepts, overlapping. Distance = 0.00000 Same slope, same intercepts, disjoint. Distance = 6.70820 Different slopes, intersecting. Distance = 0.00000 Different slopes, not intersecting. Distance = 2.23901 TEST28 LINES_SEG_DIST_3D computes the distance between line segments in 3D. Case Computed True 1 5.00000 5.00000 2 0.00000 0.00000 3 3.00000 3.00000 4 0.00000 0.00000 5 1.00000 1.00000 6 3.00000 3.00000 7 1.00000 1.00000 8 10.0000 10.0000 9 4.00000 4.00000 TEST284 LINES_SEG_INT_1D searches for an intersection of two line segments in 1D. All tests use the same line segment 1: (X1,X2) = -1.00000 1.00000 Test 1 (X3,X4) = -1.00000 1.00000 The line segments intersect: ¿€ 1.00000 Test 2 (X3,X4) = 3.00000 2.00000 The line segments do not intersect. Test 3 (X3,X4) = 1.00000 2.00000 The line segments intersect: ?€ 1.00000 Test 4 (X3,X4) = 0.500000 -3.00000 The line segments intersect: ¿€ 0.500000 Test 5 (X3,X4) = 0.250000 0.500000 The line segments intersect: >€ 0.500000 Test 6 (X3,X4) = 0.500000 0.500000 The line segments intersect: ? 0.500000 Test 7 (X3,X4) = 2.00000 2.00000 The line segments do not intersect. TEST285 LINES_SEG_INT_2D searches for an intersection of two line segments in 2D. All tests use the same line segment 1: (X1,Y1) = -1.00000 3.00000 (X2,Y2) = 1.00000 1.00000 Test 1 (X3,Y3) = -1.00000 1.00000 (X4,Y4) = 1.00000 -1.00000 The line segments do not intersect. Test 2 (X3,Y3) = 3.00000 -1.00000 (X4,Y4) = 2.00000 0.00000 The line segments do not intersect. Test 3 (X3,Y3) = 0.00000 0.00000 (X4,Y4) = 0.00000 9.00000 The line segments intersect: € 2.00000 Test 4 (X3,Y3) = 1.00000 2.00000 (X4,Y4) = 3.00000 2.00000 The line segments do not intersect. TEST29 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.00000 2.00000 The points straddle a minimum. XMIN, YMIN = 7.00000 2.00000 The points straddle a maximum. XMIN, YMIN = 2.00000 5.00000 TEST30 MINQUAD finds the minimum of a function F(X) = A * X**2 + B * X + C within an interval, given three data points. The minimum lies in the interval. X1, Y1 = 0.00000 5.00000 X2, Y2 = 2.00000 5.00000 X3, Y3 = 3.00000 8.00000 XMIN, YMIN = 1.00000 4.00000 The minimum is to the left of the interval X1, Y1 = 2.00000 5.00000 X2, Y2 = 4.00000 13.0000 X3, Y3 = 5.00000 20.0000 XMIN, YMIN = 2.00000 5.00000 The function is flat. X1, Y1 = 11.0000 6.00000 X2, Y2 = 6.00000 6.00000 X3, Y3 = 2.00000 6.00000 XMIN, YMIN = 11.0000 6.00000 The function has a maximum. X1, Y1 = 0.00000 3.00000 X2, Y2 = 2.00000 3.00000 X3, Y3 = 3.00000 0.00000 XMIN, YMIN = 3.00000 0.00000 TEST32 PARA_CONTAINS_POINT_2D determines if a point is within a parallelogram in 2D. X, Y, Inside? 1.00000 0.500000 T 2.00000 0.00000 F 0.500000 -0.100000 T 0.100000 0.500000 T TEST33 PARA_CONTAINS_POINT_3D determines if a point is within a parallelogram in 3D. X, Y, Z, Inside? 1.00000 1.00000 0.500000 T 3.00000 3.00000 0.00000 F 0.500000 0.500000 -0.100000 F 0.100000 0.100000 0.500000 F 1.50000 1.60000 0.500000 F TEST34 PLANE_EXP_NORMAL_3D finds the normal to a plane. (X,Y,Z) coordinates of 3 points: -10.5600 -10.5600 78.0900 44.6600 -65.7700 0.00000 44.6600 44.6600 0.00000 (X,Y,Z) coordinates of unit normal vector: 0.816487 0.00000 0.577364 TEST35 PLANE_EXP2IMP_3D puts a plane defined by 3 points into A*X+B*Y+C*Z+D = 0 form. P1, P2, P3: -1.00000 0.00000 -1.00000 -4.00000 0.00000 0.00000 -20.0000 2.00000 4.00000 (A,B,C,D)= -2.00000 -4.00000 -6.00000 -8.00000 Correct answer is a multiple of 1, 2, 3, 4. P1, P2, P3: -16.0000 2.00000 4.00000 0.00000 0.00000 0.00000 4.00000 -2.00000 0.00000 (A,B,C,D)= -8.00000 -16.0000 -24.0000 0.00000 Correct answer is a multiple of 1, 2, 3, 0. TEST36 PLANE_EXP2NORM_3D puts a plane defined by 3 points into point, normal form P1, P2, P3: -1.00000 0.00000 -1.00000 -4.00000 0.00000 0.00000 -20.0000 2.00000 4.00000 Point, Normal: -1.00000 0.00000 -1.00000 -0.267261 -0.534522 -0.801784 P1, P2, P3: -16.0000 2.00000 4.00000 0.00000 0.00000 0.00000 4.00000 -2.00000 0.00000 Point, Normal: -16.0000 2.00000 4.00000 -0.267261 -0.534522 -0.801784 TEST37 PLANE_EXP_PROJECT_3D projects a point through a focus point into a plane. (XO,YO,ZO), (XP,YP,ZP), IVIS 0.000 2.000 2.000 0.000 0.5000 0.5000 3 4.000 5.000 -8.000 4.000 5.000 -8.000 1 0.2500 0.2500 0.2500 0.3333 0.3333 0.3333 1 5.000 -2.000 -3.000 -0.1071E+08 0.4285E+07 0.6428E+07 -1 -2.000 0.000 0.000 1.000 0.000 0.000 -1 TEST38 PLANE_IMP2EXP_3D converts a plane in implicit (A,B,C,D) form to explicit form. (A,B,C,D) = 1.00000 -2.00000 -3.00000 6.00000 Output: (X1,Y1,Z1) = -6.00000 0.00000 0.00000 (X2,Y2,Z2) = -5.03638 0.148250 0.222375 (X3,Y3,Z3) = -6.00000 -0.832050 0.554700 TEST39 PLANE_IMP2NORM_3D converts a plane in implicit (A,B,C,D) form to point, normal form. Input: (A,B,C,D) = ?€ À À@ @À Output: (XP,YP,ZP) = -6.00000 0.00000 0.00000 (XN,YN,ZN) = 0.267261 -0.534522 -0.801784 TEST40 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.00000 2.00000 3.00000 Expected answer: The plane and line intersect at 7, 2, 3. TEST41 PLANE_IMP_LINE_SEG_NEAR_3D finds the point on a line segment nearest a plane. The distance between the plane and the line segment is 0.00000 A nearest point on the line segment is 7.00000 2.00000 3.00000 A nearest point on the plane is 7.00000 2.00000 3.00000 The distance between the plane and the line segment is 4.00892 A nearest point on the line segment is 5.00000 1.00000 -2.00000 A nearest point on the plane is 3.92857 3.14286 1.21429 TEST42 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.00000 0.00000 1.00000 -10.0000 (X,Y,Z) DISTANCE SIGNED_DISTANCE -12.0000 14.0000 0.00000 10.0000 -10.0000 7.00000 8.00000 9.00000 1.00000 -1.00000 1.00000 2.00000 10.0000 0.00000 0.00000 0.00000 0.00000 12.0000 2.00000 2.00000 TEST43 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.00000 -2.00000 -3.00000 6.00000 Triangle vertices: 3.00000 0.00000 -7.00000 13.0000 -4.00000 -1.00000 5.00000 1.00000 -2.00000 Triangle to plane distance is 4.00892 Nearest points 5.00000 1.00000 -2.00000 3.92857 3.14286 1.21429 5.00000 1.00000 -2.00000 3.92857 3.14286 1.21429 Triangle vertices: 3.00000 0.00000 -7.00000 13.0000 -4.00000 -1.00000 9.00000 3.00000 8.00000 Triangle to plane distance is 0.00000 Nearest points 10.3333 0.666666 5.00000 7.00000 2.00000 3.00000 TEST44 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.00000 -2.00000 -3.00000 6.00000 Case 1 Triangle vertices: 3.00000 0.00000 -7.00000 13.0000 -4.00000 -1.00000 5.00000 1.00000 -2.00000 Number of intersection points is 0 Case 2 Triangle vertices: 3.00000 0.00000 -7.00000 13.0000 -4.00000 -1.00000 9.00000 3.00000 8.00000 Number of intersection points is 2 1 7.00000 2.00000 3.00000 2 10.3333 0.666667 5.00000 Case 3 Triangle vertices: -6.00000 0.00000 0.00000 0.00000 3.00000 0.00000 0.00000 0.00000 2.00000 Number of intersection points is 3 1 -6.00000 0.00000 0.00000 2 0.00000 3.00000 0.00000 3 0.00000 0.00000 2.00000 Case 4 Triangle vertices: -4.00000 1.00000 0.00000 0.00000 6.00000 -2.00000 0.00000 0.00000 1.00000 Number of intersection points is 2 1 -4.00000 1.00000 0.00000 2 0.00000 6.00000 -2.00000 TEST45 PLANE_NORM_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. Input: P 0.00000 0.00000 0.00000 N 1.00000 1.00000 1.00000 Output: Q 0.816497 -0.408248 -0.408248 R 0.00000 0.707107 -0.707107 N dot N = 3.00000 N dot Q = -0.596046E-07 N dot R = 0.00000 Q dot Q = 1.00000 Q dot R = 0.00000 R dot R = 1.00000 TEST46 PLANE_NORM_TRIANGLE_INT_3D finds the intersection points of a normal form plane and a triangle. The normal plane is determined by the point: 0.00000 0.00000 2.00000 and the normal vector: 1.00000 -2.00000 -3.00000 Case 1 Triangle vertices: 3.00000 0.00000 -7.00000 13.0000 -4.00000 -1.00000 5.00000 1.00000 -2.00000 Number of intersection points is 0 Case 2 Triangle vertices: 3.00000 0.00000 -7.00000 13.0000 -4.00000 -1.00000 9.00000 3.00000 8.00000 Number of intersection points is 2 1 7.00000 2.00000 3.00000 2 10.3333 0.666667 5.00000 Case 3 Triangle vertices: -6.00000 0.00000 0.00000 0.00000 3.00000 0.00000 0.00000 0.00000 2.00000 Number of intersection points is 3 1 -6.00000 0.00000 0.00000 2 0.00000 3.00000 0.00000 3 0.00000 0.00000 2.00000 Case 4 Triangle vertices: -4.00000 1.00000 0.00000 0.00000 6.00000 -2.00000 0.00000 0.00000 1.00000 Number of intersection points is 2 1 -4.00000 1.00000 0.00000 2 0.00000 6.00000 -2.00000 TEST47 PLANE_NORM2EXP_3D puts a plane defined by point, normal form into explicit form. Input: (XP,YP,ZP)= -1.00000 0.00000 -1.00000 (XN,YN,ZN)= -0.267261 -0.534522 -0.801784 Output: (X1,Y1,Z1)= -1.00000 0.00000 -1.00000 (X2,Y2,Z2)= -0.363759E-01 -0.148250 -1.22237 (X3,Y3,Z3)= -1.00000 -0.832050 -0.445300 TEST48 PLANE_NORM2IMP_3D puts a plane defined by point, normal form into implicit ABCD form. Input: (XP,YP,ZP)= -1.00000 0.00000 -1.00000 (XN,YN,ZN)= -0.267261 -0.534522 -0.801784 Output: (A,B,C,D)= -0.267261 -0.534522 -0.801784 -1.06904 Input: (XP,YP,ZP)= -16.0000 2.00000 4.00000 (XN,YN,ZN)= -0.267261 -0.534522 -0.801784 Output: (A,B,C,D)= -0.267261 -0.534522 -0.801784 0.476837E-06 TEST49 POINTS_COLIN_2D estimates the colinearity of three points. Points almost on a line: Expect COLIN to be close to 0 0.00000 A 10.0000 @  4.99000 Colinearity index = 0.129907E-02 Two points close, one far: Expect COLIN to be close to 0 0.00000 1.00000 BÈ 0.00000 Colinearity index = 0.257216E-01 Points on an equilateral triangle: Expect COLIN to be close to 1 0.00000 ?€ 0.00000 ? 0.866025 Colinearity index = 1.00000 TEST499 POINTS_DELAUNAY_NAIVE_2D computes the Delaunay triangulation of a set of points. The points: 1 7.00000 3.00000 2 4.00000 7.00000 3 5.00000 13.0000 4 2.00000 7.00000 5 6.00000 9.00000 6 12.0000 8.00000 7 3.00000 4.00000 8 6.00000 6.00000 9 3.00000 10.0000 10 8.00000 7.00000 11 5.00000 13.0000 12 10.0000 6.00000 The Delaunay triangles are: 1 1 7 8 2 1 8 10 3 1 10 12 4 2 4 9 5 2 5 8 6 2 7 4 7 2 8 7 8 2 9 5 9 3 5 9 10 3 6 5 11 5 6 10 12 5 9 11 13 5 10 8 14 5 11 6 15 6 12 10 TEST4995 POINTS_DIST_SPHERE measures the distance between two points on a sphere. All tests uses RADIUS = 3957.00 which is the radius of the earth in miles. Distance from Atlanta, Georgia to North Pole 3923.91 to South Pole 8507.37 to Timbuktu 4995.76 to San Antonio, Texas 974.432 to Savannah, Georgia 114.229 Distance from North Pole to South Pole 12431.3 to Timbuktu 5054.24 to San Antonio, Texas 4184.05 to Savannah, Georgia 3999.88 Distance from South Pole to Timbuktu 7377.05 to San Antonio, Texas 8247.23 to Savannah, Georgia 8431.40 Distance from Timbuktu to San Antonio, Texas 5969.44 to Savannah, Georgia 4922.94 Distance from San Antonio, Texas to Savannah, Georgia 1047.82 TEST50 POINTS_HULL_2D computes the convex hull of a set of points. The points: 1 7.00000 3.00000 2 4.00000 7.00000 3 5.00000 13.0000 4 2.00000 7.00000 5 6.00000 9.00000 6 12.0000 8.00000 7 3.00000 4.00000 8 6.00000 6.00000 9 3.00000 10.0000 10 8.00000 7.00000 11 5.00000 13.0000 12 10.0000 6.00000 The convex hull is formed by connecting: 1 4 2.00000 7.00000 2 9 3.00000 10.0000 3 3 5.00000 13.0000 4 6 12.0000 8.00000 5 12 10.0000 6.00000 6 1 7.00000 3.00000 7 7 3.00000 4.00000 The correct sequence of nodes is: 4, 9, 3, 6, 12, 1, 7, (4). TEST505 POINTS_CENTROID_2D computes the centroid of a discrete set of points. The points: 1 7.00000 3.00000 2 4.00000 7.00000 3 5.00000 13.0000 4 2.00000 7.00000 5 6.00000 9.00000 6 12.0000 8.00000 7 3.00000 4.00000 8 6.00000 6.00000 9 3.00000 10.0000 10 8.00000 7.00000 11 5.00000 13.0000 12 10.0000 6.00000 The centroid is point #: 5 TEST0595 Given a point in 2D, we want to find its nearest neighbor among points in a set. POINTS_NEAREST_POINT_NAIVE_2D uses a naive algorithm. POINTS_NEAREST_POINT_BINS_2D and POINTS_NEAREST_POINT_BINS2_2D use bins, but require the same number in each direction. POINTS_NEAREST_POINT_BINS3_2D uses bins, and can use a different number in each direction. The number of points in the pointset is 1000 POINTS_NEAREST_POINT_BINS_2D and POINTS_NEAREST_POINT_BINS2_2D use 10 bins in each direction. POINTS_NEAREST_POINT_BINS3_2D uses 20 5 bins in each direction. The X coordinate range: 0.00000 20.0000 The Y coordinate range: 0.00000 5.00000 Test point X range: 0.00000 20.0000 Test point Y range: 0.00000 5.00000 Test point Neighbor point Distance -------------------- -------------------- ---------- 3.5367 3.1591 3.3750 2.9184 0.2900 1000 3.5367 3.1591 3.3750 2.9184 0.2900 87 3.5367 3.1591 3.3750 2.9184 0.2900 87 3.5367 3.1591 3.5126 3.7109 0.2900 89 14.0216 1.9964 14.1019 1.8692 0.1504 1000 14.0216 1.9964 14.1019 1.8692 0.1504 82 14.0216 1.9964 14.1019 1.8692 0.1504 82 14.0216 1.9964 14.4565 0.5297 0.1504 77 7.4027 2.2544 7.4348 2.2631 0.0332 1000 7.4027 2.2544 7.4348 2.2631 0.0332 3 7.4027 2.2544 7.4348 2.2631 0.0332 3 7.4027 2.2544 6.1130 3.5589 0.0332 8 12.3594 2.7250 12.2459 2.9462 0.2487 1000 12.3594 2.7250 12.2459 2.9462 0.2487 92 12.3594 2.7250 12.2459 2.9462 0.2487 92 12.3594 2.7250 12.0573 1.0693 0.2487 11 0.7419 2.5489 0.9858 2.5649 0.2444 1000 0.7419 2.5489 0.9858 2.5649 0.2444 61 0.7419 2.5489 0.9858 2.5649 0.2444 61 0.7419 2.5489 0.3678 1.6832 0.2444 11 11.5056 2.6542 11.6223 2.5201 0.1777 1000 11.5056 2.6542 11.6223 2.5201 0.1777 92 11.5056 2.6542 11.6223 2.5201 0.1777 92 11.5056 2.6542 10.1704 4.2455 0.1777 7 1.9597 0.8247 2.0877 1.0356 0.2467 1000 1.9597 0.8247 2.0877 1.0356 0.2467 65 1.9597 0.8247 2.0877 1.0356 0.2467 65 1.9597 0.8247 3.7432 0.3782 0.2467 60 6.8098 3.9928 6.7127 3.9792 0.0980 1000 6.8098 3.9928 6.7127 3.9792 0.0980 98 6.8098 3.9928 6.7127 3.9792 0.0980 98 6.8098 3.9928 7.7313 1.4317 0.0980 77 6.3245 3.2488 6.2366 3.3423 0.1283 1000 6.3245 3.2488 6.2366 3.3423 0.1283 11 6.3245 3.2488 6.2366 3.3423 0.1283 11 6.3245 3.2488 7.1484 1.0214 0.1283 10 10.3481 2.1260 10.1903 2.1193 0.1580 1000 10.3481 2.1260 10.1903 2.1193 0.1580 70 10.3481 2.1260 10.1903 2.1193 0.1580 70 10.3481 2.1260 11.8042 0.6313 0.1580 86 TEST0596 Given a point set in 2D, and a set of test points, for each testpoint, find the nearest neighbor in the point set. POINTS_NEAREST_POINTS_NAIVE_2D uses a naive algorithm. POINTS_NEAREST_POINTS_BINS_2D uses equal bins. POINTS_NEAREST_POINTS_BINS2_2D uses equal bins. POINTS_NEAREST_POINTS_BINS3_2D uses variable bins. The number of points in the pointset is 1000 The number of points in the test set is 100 POINTS_NEAREST_POINTS_BINS_2D and POINTS_NEAREST_POINTS_BINS2_2D use 10 bins in each direction. POINTS_NEAREST_POINTS_BINS3_2D uses 10 10 bins in each direction. The X coordinate range: 0.00000 10.0000 The Y coordinate range: 0.00000 10.0000 Print results for up to first 10 points... Test point Distance Naive Bins Bins2 Bins3 -------------------- ------------------------------------ 7.4742 5.3056 0.2833 0.2833 0.2833 0.2833 9.8240 8.8997 0.1555 0.1555 0.1555 0.1555 6.7530 1.6609 0.1081 0.1081 0.1081 0.1081 6.1976 4.6157 0.1160 0.1160 0.1160 0.1160 3.6908 0.0889 0.3411 0.3411 0.3411 0.3411 6.4060 4.2723 0.1540 0.1540 0.1540 0.1540 0.7340 6.1063 0.1230 0.1230 0.1230 0.1230 5.2808 8.9886 0.1181 0.1181 0.1181 0.1181 7.0829 2.2496 0.0335 0.0335 0.0335 0.0335 9.0258 6.6358 0.1664 0.1664 0.1664 0.1664 Naive and bin1 codes computed the same results. Naive and bin2 codes computed the same results. Naive and bin3 codes computed the same results. Naive code time = 0.388000E-01 Bin code time = 0.410000E-02 Bin2 code time = 0.310000E-02 Bin3 code time = 0.320000E-02 TEST05965 Given a point set in 2D, and a set of test points, for each testpoint, find the nearest neighbor in the point set. In this test, the region is RECTANGULAR. The BINS and BINS2 codes will end up using rectangular bins; We will set the BINS3 code to use the same number of bins, but they will be square. This should mean that BINS3 finds a match faster. POINTS_NEAREST_POINTS_NAIVE_2D uses a naive algorithm. POINTS_NEAREST_POINTS_BINS_2D uses bins. POINTS_NEAREST_POINTS_BINS2_2D uses bins. POINTS_NEAREST_POINTS_BINS3_2D uses bins. The number of points in the pointset is 1000 The number of bins used in each direction is 10 The number of points in the test set is 100 The X coordinate range: 0.00000 4.00000 The Y coordinate range: 0.00000 25.0000 Print results for up to first 10 points... Test point Distance Naive Bins Bins2 Bins3 -------------------- ------------------------------------ 3.9526 24.7475 0.1563 0.1563 0.1563 0.1563 0.1747 16.8491 0.1405 0.1405 0.1405 0.1405 3.2187 6.2954 0.1233 0.1233 0.1233 0.1233 0.5535 19.6677 0.3257 0.3257 0.3257 0.3257 0.6991 12.6408 0.1114 0.1114 0.1114 0.1114 0.8647 10.6262 0.2104 0.2104 0.2104 0.2104 0.0246 18.2932 0.1755 0.1755 0.1755 0.1755 1.6068 6.3214 0.0809 0.0809 0.0809 0.0809 1.0631 9.2803 0.1520 0.1520 0.1520 0.1520 3.8562 0.2186 0.1570 0.1570 0.1570 0.1570 Naive and bin1 codes computed the same results. Naive and bin2 codes computed the same results. Naive and bin3 codes computed the same results. Naive code time = 0.377000E-01 Bin code time = 0.420000E-02 Bin2 code time = 0.370000E-02 Bin3 code time = 0.280000E-02 TEST0597 Given a point set in 3D, and a set of test points, for each testpoint, find the nearest neighbor in the point set. POINTS_NEAREST_POINTS_NAIVE_3D uses a naive algorithm. POINTS_NEAREST_POINTS_BINS2_3D uses bins. The number of points in the pointset is 4096 The number of bins used in each direction is 32 The number of points in the test set is 1000 The X coordinate range: 0.00000 10.0000 The Y coordinate range: 0.00000 10.0000 The Z coordinate range: 0.00000 10.0000 Print up to the first 10 points. Test point Distance Comparisons Naive Bins Naive Bins ----------------------------- -------------------- ---------- 4.2518 7.6657 7.5846 0.4666 0.4666 4096 13 9.0811 2.5066 1.6360 0.5522 0.5522 4096 9 1.3238 5.5080 9.7886 0.3434 0.3434 4096 2 5.2061 2.4371 9.7954 0.2351 0.2351 4096 3 3.2220 6.6974 8.6295 0.5338 0.5338 4096 16 0.1356 8.3664 2.4830 0.1664 0.1664 4096 1 6.5274 1.2886 8.7310 0.3886 0.3886 4096 15 0.4856 3.3764 9.0531 0.4328 0.4328 4096 18 5.8720 2.7303 5.1322 0.2561 0.2561 4096 6 3.3480 2.4738 4.9927 0.6050 0.6050 4096 15 Naive and bin codes computed the same results. Naive code time = 2.07610 Bin code time = 0.941000E-01 TEST0598 Given a point set XC, and a single point XD, find the nearest point in XC to XD. POINTS_NEAREST_POINT_NAIVE_2D uses a naive method. POINTS_NEAREST_POINT_DEL_2D uses the Delaunay triangulation TRIANGULATION_PRINT prints a triangulation. RANDOM_INITIALIZE Initialize RANDOM_NUMBER with arbitrary SEED = 1569955397 TRIANGULATION_PRINT Information defining a triangulation. The number of points is 13 Point coordinates (transpose of internal array) 1 2 1 -2.00000 2.00000 2 -1.00000 3.00000 3 0.00000 0.00000 4 2.00000 2.00000 5 5.00000 6.00000 6 6.00000 4.00000 7 6.00000 7.00000 8 7.00000 4.00000 9 8.00000 2.00000 10 8.00000 8.00000 11 9.00000 5.00000 12 10.0000 4.00000 13 11.0000 7.00000 The number of triangles is 16 Sets of three points are used as vertices of the triangles. For each triangle, the points are listed in counterclockwise order. Nodes that make up triangles (transpose of internal array) 1 2 3 1 2 1 3 2 2 3 4 3 2 4 5 4 4 3 9 5 5 4 6 6 5 6 7 7 2 5 7 8 6 4 9 9 7 6 8 10 8 6 9 11 11 8 9 12 7 8 11 13 10 7 11 14 11 9 12 15 13 11 12 16 10 11 13 On each side of a given triangle, there is either another triangle, or a piece of the convex hull. For each triangle, we list the indices of the three neighbors, or (if negative) the codes of the segments of the convex hull. Indices of neighboring triangles (transpose of internal array) 1 2 3 1 -4 -13 2 2 1 4 3 3 2 5 7 4 2 -43 8 5 3 8 6 6 5 9 7 7 3 6 -3 8 5 4 10 9 6 10 12 10 9 8 11 11 12 10 14 12 9 11 13 13 -23 12 16 14 11 -47 15 15 16 14 -50 16 13 15 -39 The number of boundary points is 8 The segments that make up the convex hull can be determined from the negative entries of the triangle neighbor list. # Tri Side N1 N2 1 1 2 1 3 2 4 2 3 9 3 14 2 9 12 4 1 1 2 1 5 7 3 7 2 6 15 3 12 13 7 16 3 13 10 8 13 1 10 7 X Y Distance Index XD 8.5031 4.5827 Naive 9.0000 5.0000 0.6489 11 Delaunay 9.0000 5.0000 0.6489 11 XD -0.6485 2.4048 Naive -1.0000 3.0000 0.6912 2 Delaunay -1.0000 3.0000 0.6912 2 XD 4.1793 4.8374 Naive 5.0000 6.0000 1.4231 5 Delaunay 5.0000 6.0000 1.4231 5 XD 6.2616 3.4223 Naive 6.0000 4.0000 0.6342 6 Delaunay 6.0000 4.0000 0.6342 6 XD 5.8971 3.7364 Naive 6.0000 4.0000 0.2830 6 Delaunay 6.0000 4.0000 0.2830 6 XD 6.3662 3.5338 Naive 6.0000 4.0000 0.5928 6 Delaunay 6.0000 4.0000 0.5928 6 XD 5.1150 2.9998 Naive 6.0000 4.0000 1.3355 6 Delaunay 6.0000 4.0000 1.3355 6 XD 7.5632 7.4560 Naive 8.0000 8.0000 0.6976 10 Delaunay 8.0000 8.0000 0.6976 10 XD 8.1184 7.7909 Naive 8.0000 8.0000 0.2403 10 Delaunay 8.0000 8.0000 0.2403 10 XD 0.1485 3.5875 Naive -1.0000 3.0000 1.2900 2 Delaunay -1.0000 3.0000 1.2900 2 TEST506 POINTS_NEAREST_POINT_NAIVE_ND computes the nearest point in a set of points, to a given point, in ND. The spatial dimension NDIM is 2 The number of points N is 12 The set of points: 1 2 3 4 5 1 7.00000 4.00000 5.00000 2.00000 6.00000 2 3.00000 7.00000 13.0000 7.00000 9.00000 6 7 8 9 10 1 12.0000 3.00000 6.00000 3.00000 8.00000 2 8.00000 4.00000 6.00000 10.0000 7.00000 11 12 1 5.00000 10.0000 2 13.0000 6.00000 Test point is 7.00000 1.00000 Nearest point is 7.00000 3.00000 Distance is 2.00000 Test point is 4.00000 7.00000 Nearest point is 4.00000 7.00000 Distance is 0.00000 Test point is 8.00000 11.0000 Nearest point is 6.00000 9.00000 Distance is 2.82843 TEST52 For a polygon in 2D: POLYGON_AREA_2D computes the area; POLYGON_AREA_2_2D computes the area; POLYGON_CENTROID_2D computes the centroid. POLYGON_CENTROID_2_2D computes the centroid. The polygonal vertices: 1 1.00000 0.00000 2 2.00000 1.00000 3 1.00000 2.00000 4 0.00000 1.00000 Exact area is 0.500000 The computed area is 2.00000 The computed area is 2.00000 The computed centroid is 1.00000 1.00000 The computed centroid is 1.00000 1.00000 TEST53 For a polygon in 3D: POLYGON_AREA_3D computes the area; POLYGON_AREA_2_3D computes the area; POLYGON_CENTROID_3D computes the centroid. Vertices: 1.00000 0.00000 0.00000 2.00000 1.00000 1.00000 1.00000 2.00000 1.00000 0.00000 1.00000 0.00000 Exact area is 2.44949 The computed area is 2.44949 The computed area is 2.44949 The unit normal vector: -0.408248 -0.408248 0.816497 Centroid: 1.00000 1.00000 0.500000 TEST54 POLYGON_CONTAINS_POINT_2D determines if a point is in a polygon. POLYGON_CONTAINS_POINT_2_2D determines if a point is in a polygon. X, Y, Inside1 Inside2 1.00000 1.00000 T T 3.00000 4.00000 F F 0.00000 2.00000 T T 0.500000 -0.250000 F F TEST55 POLYGON_CONVEX determines if a polygon is convex. Shape #1, a point: 1 0.00000 0.00000 The polygon is degenerate and convex. Shape #2, a line: 1 0.00000 0.00000 2 1.00000 2.00000 The polygon is degenerate and convex. Shape #3, a flat triangle: 1 0.00000 0.00000 2 2.00000 0.00000 3 1.00000 0.00000 The polygon is convex and clockwise. Shape #4, a CCW triangle: 1 0.00000 0.00000 2 1.00000 0.00000 3 0.00000 2.00000 The polygon is convex and counterclockwise. Shape #5, a CW triangle: 1 0.00000 0.00000 2 0.00000 2.00000 3 1.00000 0.00000 The polygon is convex and clockwise. Shape #6, a polygon with large interior angle: 1 1.00000 0.00000 2 2.00000 0.00000 3 3.00000 1.00000 4 0.00000 1.00000 The polygon is convex and counterclockwise. Shape #7, a polygon with huge interior angle: 1 0.00000 0.00000 2 0.500000 0.500000 3 1.00000 0.00000 4 1.00000 1.00000 5 0.00000 1.00000 The polygon is not convex. Shape #8, a star: 1 1.00000 0.00000 2 -0.809017 0.587785 3 0.309017 -0.951056 4 0.309017 0.951057 5 -0.809017 -0.587785 The polygon is not convex. Shape #9, a regular hexagon: 1 1.00000 0.00000 2 0.500000 0.866025 3 -0.500000 0.866025 4 -1.00000 -0.874228E-07 5 -0.500000 -0.866025 6 0.500000 -0.866025 The polygon is convex and counterclockwise. Shape #10, a double triangle: 1 0.00000 0.00000 2 2.00000 0.00000 3 1.00000 1.00000 4 0.00000 0.00000 5 2.00000 0.00000 6 1.00000 1.00000 The polygon is not convex. Shape #11, a square knot: 1 1.00000 0.00000 2 3.00000 0.00000 3 3.00000 3.00000 4 0.00000 3.00000 5 0.00000 1.00000 6 2.00000 1.00000 7 2.00000 2.00000 8 1.00000 2.00000 The polygon is not convex. TEST56 For a polyhedron in 3D: POLYHEDRON_SURFACE_3D computes surface area; POLYHEDRON_VOLUME_3D 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 Nodal coordinates: 1 0.00000 0.00000 0.00000 2 1.00000 0.00000 0.00000 3 0.00000 1.00000 0.00000 4 0.00000 0.00000 1.00000 Surface area = 2.36603 Exact area = 2.36603 Volume = 0.166667 Exact = 0.166667 TEST57 POLYLINE_INDEX_POINT_ND finds a point on a polyline with given arclength. POLYLINE_LENGTH_ND computes the arclength of the polyline, and its nodes. The line we examine is defined by these points: X Y Arclength(X,Y) 0.00000 0.00000 0.00000 1.00000 1.00000 1.41421 2.00000 0.00000 2.82843 0.00000 0.00000 4.82843 We search for the point with coordinate 2.00000 The computed point is 1.41421 0.585786 TEST58 PROPLANE3 projects an object point orthographically into a plane. (XO,YO,ZO), (XP,YP,ZP) 0.000 2.000 2.000 -1.000 1.000 1.000 4.000 5.000 -8.000 4.000 5.000 -8.000 0.2500 0.2500 0.2500 0.3333 0.3333 0.3333 5.000 -2.000 -3.000 5.333 -1.667 -2.667 -2.000 0.000 0.000 -1.000 1.000 1.000 TEST170 PROVEC projects a vector onto a subspace. Base vectors: 4.00000 3.00000 2.00000 1.00000 1.00000 2.00000 3.00000 4.00000 Vector to be projected: 1.00000 1.00000 1.00000 2.00000 Projected vector in BASE coordinates 2.00832 1.63299 Projected vector in original coordinates 0.800000 1.10000 1.40000 1.70000 TEST171 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 corners: 0.00000 0.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 QUAD_AREA_2D reports the area is 1.00000 X Y INQUAD DISQUAD DISQUAD 0.250000 0.250000 F -0.2500 0.2500 0.750000 0.250000 F -0.2500 0.2500 1.00000 1.00000 F 0.0000 0.0000 11.0000 0.500000 F 10.0000 10.0000 0.00000 0.500000 F 0.0000 0.0000 0.500000 -10.0000 F 10.0000 10.0000 2.00000 2.00000 F 1.0000 1.4142 TEST172 QUAT_CONJ conjugats a quaternion; QUAT_INV inverts a quaternion; QUAT_MUL multiplies quaternions. QUAT_NORM computes the norm. Q1 = 2.00000 3.00000 4.00000 5.00000 Norm ( Q1 ) = 7.34847 Q2 = conj(Q1) = 2.00000 -3.00000 -4.00000 -5.00000 Q3 = Q1*Q2 = 54.0000 0.00000 0.00000 0.00000 Q2 = inv(Q1) = 0.370370E-01 -0.555556E-01 -0.740741E-01 -0.925926E-01 Q3 = Q1*Q2 = 1.00000 0.298023E-07 -0.298023E-07 0.149012E-07 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.0000 0.0000 6.0000 0.0000 1.5708 90.0000 0.0000 0.0000 0.0000 90.0000 1.5708 90.0000 0.0000 0.0000 3.0000 35.2644 0.9553 54.7356 0.0000 0.0000 22.5466 -10.5197 0.4205 24.0948 0.0000 0.0000 15.0000 -35.2644 2.1863 125.2644 6.0000 0.0000 0.0000 90.0000 1.5708 90.0000 6.0000 0.0000 3.0000 35.2644 0.9553 54.7356 6.0000 0.0000 22.5466 -10.5197 1.9446 111.4167 6.0000 0.0000 15.0000 -35.2644 2.1863 125.2644 0.0000 90.0000 3.0000 35.2644 0.9553 54.7356 0.0000 90.0000 22.5466 -10.5197 1.7544 100.5197 0.0000 90.0000 15.0000 -35.2644 2.1863 125.2644 3.0000 35.2644 22.5466 -10.5197 1.3584 77.8297 3.0000 35.2644 15.0000 -35.2644 3.1416 180.0000 22.5466 -10.5197 15.0000 -35.2644 1.7832 102.1703 TEST174 RADEC_TO_XYZ converts XYZ to RADEC coordinates. XYZ_TO_RADEC converts RADEC to XYZ coordinates. X Y Z RA DEC X Y Z 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 1.000 0.000 6.000 0.000 0.000 1.000 0.000 0.000 0.000 1.000 0.000 90.000 0.000 0.000 1.000 1.000 1.000 1.000 3.000 35.264 0.577 0.577 0.577 5.000 -2.000 -1.000 22.547-10.520 0.913 -0.365 -0.183 -2.000 -2.000 -2.000 15.000-35.264 -0.577 -0.577 -0.577 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 is: 1.00000 4.00000 10.0000 Rotation axis is 0.236174 -0.881412 -0.409065 Rotation angle is 1.15980 Rotated vector is: -7.22724 2.96410 7.48205 Rotation matrix: 0.433013 0.250000 -0.866025 -0.500000 0.866025 0.00000 0.750000 0.433013 0.500000 Rotated vector is: -7.22724 2.96410 7.48205 Rotation quaternion: 0.836516 0.129410 -0.482963 -0.224144 Rotated vector is: -7.22724 2.96410 7.48205 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. Rotation matrix: 0.433013 0.250000 -0.866025 -0.500000 0.866025 0.00000 0.750000 0.433013 0.500000 Rotation axis is 0.236174 -0.881412 -0.409065 Rotation angle is 1.15980 Rotation matrix: 0.433013 0.250000 -0.866026 -0.500000 0.866025 0.447035E-07 0.750000 0.433013 0.500000 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: 0.236174 -0.881412 -0.409065 Rotation angle is 1.15980 Rotation quaternion: 0.836516 0.129410 -0.482963 -0.224144 Rotation axis: 0.236174 -0.881412 -0.409065 Rotation angle is 1.15980 TEST178 ROTATION_MAT2QUAT_3D computes a rotation quaternion from a rotation matrix. ROTATION_QUAT2MAT_3D computes a rotation matrix from a rotation quaternion. Rotation matrix: 0.433013 0.250000 -0.866025 -0.500000 0.866025 0.00000 0.750000 0.433013 0.500000 Rotation quaternion: 0.836516 0.129410 -0.482963 -0.224144 Rotation matrix: 0.433013 0.250000 -0.866025 -0.500000 0.866025 0.00000 0.750000 0.433013 0.500000 TEST179 SOCCER_SHAPE_3D returns information abou the truncated icosahedron, or soccer ball. We will use this information to compute the areas and centers of each face. Face Order Area 1 6 0.4411 2 6 0.4411 3 5 0.2921 4 6 0.4411 5 5 0.2921 6 6 0.4411 7 5 0.2921 8 6 0.4411 9 6 0.4411 10 6 0.4411 11 5 0.2921 12 6 0.4411 13 5 0.2921 14 6 0.4411 15 5 0.2921 16 6 0.4411 17 6 0.4411 18 6 0.4411 19 5 0.2921 20 6 0.4411 21 5 0.2921 22 5 0.2921 23 6 0.4411 24 6 0.4411 25 6 0.4411 26 5 0.2921 27 6 0.4411 28 5 0.2921 29 6 0.4411 30 6 0.4411 31 5 0.2921 32 6 0.4411 Face Center 1 0.1761 0.3333 0.8547 2 -0.3746 -0.0424 0.8547 3 0.1856 -0.2719 0.9007 4 0.6819 -0.0424 0.6371 5 -0.3711 0.5438 0.6972 6 -0.2091 -0.6505 0.6371 7 0.6165 0.5438 0.4938 8 0.4439 -0.6505 0.5026 9 -0.8046 0.2222 0.4194 10 0.0864 0.8302 0.4194 11 -0.7311 -0.3758 0.4938 12 0.9049 0.2222 0.0673 13 0.8668 -0.3758 0.1646 14 -0.5197 0.7616 0.1504 15 0.0339 -0.9441 0.1646 16 -0.5368 -0.7616 0.0673 17 0.5368 0.7616 -0.0673 18 0.5197 -0.7616 -0.1504 19 -0.8668 0.3758 -0.1646 20 -0.9049 -0.2222 -0.0673 21 -0.0339 0.9441 -0.1646 22 0.7311 0.3758 -0.4938 23 0.8046 -0.2222 -0.4194 24 -0.4439 0.6505 -0.5026 25 -0.0864 -0.8302 -0.4194 26 -0.6165 -0.5438 -0.4938 27 0.2091 0.6505 -0.6371 28 0.3711 -0.5438 -0.6972 29 -0.6819 0.0424 -0.6371 30 0.3746 0.0424 -0.8547 31 -0.1856 0.2719 -0.9007 32 -0.1761 -0.3333 -0.8547 TEST180 SORT_HEAP_EXTERNAL sorts objects externally. Before sorting: 5 20 2 12 20 20 12 18 19 12 4 3 2 3 19 4 4 19 2 13 After sorting: 2 2 2 3 3 4 4 4 5 12 12 12 13 18 19 19 19 20 20 20 TEST181 SPHERE_DIA2IMP_3D converts a sphere from diameter to implicit form. The endpoints of the diameter are: P1: -1.00000 -1.00000 4.00000 P2: 5.00000 7.00000 4.00000 The implicit form of the sphere is Center: 2.00000 3.00000 4.00000 Radius: 5.00000 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, X, Y, Z T 1.00000 2.00000 3.00000 F 7.00000 2.00000 3.00000 T 1.00000 5.00000 3.00000 T 2.50000 3.50000 4.50000 SPHERE_IMP_CONTAINS_POINT_3D: Inside, X, Y, Z T 1.00000 2.00000 3.00000 F 7.00000 2.00000 3.00000 T 1.00000 5.00000 3.00000 T 2.50000 3.50000 4.50000 TEST183 SPHERE_EXP_NEAR_POINT_3D determines if a point is within an explicit sphere; SPHERE_IMP_NEAR_POINT_3D determines if a point is within an implicit sphere; The sphere has center: 1.00000 2.00000 3.00000 and radius 3.00000 SPHERE_EXP_NEAR_POINT_3D: X, Y, Z, XN, YN, ZN 1.0000 2.0000 3.0000 4.0000 2.0000 3.0000 7.0000 2.0000 3.0000 4.0000 2.0000 3.0000 1.0000 5.0000 3.0000 1.0000 5.0000 3.0000 2.5000 3.5000 4.5000 2.7321 3.7321 4.7321 SPHERE_IMP_NEAR_POINT_3D: X, Y, Z, XN, YN, ZN 1.0000 2.0000 3.0000 4.0000 2.0000 3.0000 7.0000 2.0000 3.0000 4.0000 2.0000 3.0000 1.0000 5.0000 3.0000 1.0000 5.0000 3.0000 2.5000 3.5000 4.5000 2.7321 3.7321 4.7321 TEST184 SPHERE_IMP_GRIDPOINTS_3D produces a grid of points on an implicit sphere in 3D. The sphere has center: 0.00000 0.00000 0.00000 and radius 10.0000 The number of intermediate latitudes = 3 The number of longitudes = 4 The number of grid points is 14 1 0.00000 0.00000 10.0000 2 7.07107 0.00000 7.07107 3 -0.309086E-06 7.07107 7.07107 4 -7.07107 -0.618172E-06 7.07107 5 0.843216E-07 -7.07107 7.07107 6 10.0000 0.00000 -0.437114E-06 7 -0.437114E-06 10.0000 -0.437114E-06 8 -10.0000 -0.874228E-06 -0.437114E-06 9 0.119249E-06 -10.0000 -0.437114E-06 10 7.07107 0.00000 -7.07107 11 -0.309086E-06 7.07107 -7.07107 12 -7.07107 -0.618172E-06 -7.07107 13 0.843216E-07 -7.07107 -7.07107 14 -0.874228E-06 0.00000 -10.0000 TEST185 SPHERE_IMP_SPIRALPOINTS_3D produces a spiral of points on an implicit sphere in 3D. The sphere has center: 0.00000 0.00000 0.00000 and radius 1.00000 The number of spiral points is 20 The spiral points: 0.0000 0.0000 -1.0000 -0.1026 0.4347 -0.8947 -0.6136 0.0169 -0.7895 -0.3462 -0.6419 -0.6842 0.3857 -0.7184 -0.5789 0.8689 -0.1439 -0.4737 0.7100 0.6002 -0.3684 0.0334 0.9642 -0.2632 -0.6949 0.7016 -0.1579 -0.9985 -0.0159 -0.0526 -0.6798 -0.7315 0.0526 0.0656 -0.9853 0.1579 0.7562 -0.5991 0.2632 0.9119 0.1810 0.3684 0.3916 0.7888 0.4737 -0.4097 0.7050 0.5789 -0.7280 -0.0433 0.6842 -0.1218 -0.6016 0.7895 0.4464 0.0142 0.8947 0.0000 0.0000 1.0000 TEST186 SPHERE_IMP_GRIDLINES_3D computes gridlines on a sphere in 3D. Number of intermediate latitudes is 3 Number of longitudes is 4 Number of line segments is 33 Grid line vertices: 1 2 2 6 6 10 10 14 1 3 3 7 7 11 11 14 1 4 4 8 8 12 12 14 1 5 5 9 9 13 13 14 2 3 3 4 5 2 6 7 7 8 9 6 10 11 11 12 13 10 2 7 7 12 3 8 8 13 4 9 9 10 5 6 6 11 TEST187 SPHERE_IMP_GRIDFACES_3D computes gridfaces on a sphere in 3D. Number of intermediate latitudes is 3 Number of longitudes is 4 Number of triangles is 32 Triangle vertices: 2 3 1 3 4 1 4 5 1 5 2 1 6 7 2 3 2 7 7 8 3 4 3 8 8 9 4 5 4 9 9 6 5 2 5 6 10 11 6 7 6 11 11 12 7 8 7 12 12 13 8 9 8 13 13 10 9 6 9 10 14 15 10 11 10 15 15 16 11 12 11 16 16 17 12 13 12 17 17 14 13 10 13 14 15 14 18 16 15 18 17 16 18 14 17 18 TEST188 SPHERE_IMP_POINT_PROJECT_3D projects a 3D point onto a sphere. (X,Y,Z), Projected (X,Y,Z) 2.000 0.000 0.000 2.000 2.000 0.000 0.000 4.000 0.000 0.000 4.000 0.000 2.000 4.000 10.00 2.000 4.000 2.000 3.000 5.000 0.000 3.414 5.414 0.000 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.00000 N Area Volume 2 6.28319 3.14159 3 12.5664 4.18879 4 19.7392 4.93480 5 26.3189 5.26379 6 31.0063 5.16771 7 33.0734 4.72477 8 32.4697 4.05871 9 29.6866 3.29851 10 25.5016 2.55016 TEST190 For the unit sphere in 2 dimensions (the circle): SPHERE_UNIT_SAMPLE_2D samples; A few sample values: -0.9790 -0.2040 -0.7142 -0.6999 -0.9920 -0.1260 -1.0000 0.0026 0.9648 -0.2629 Number of sample points = 1000 Now average the points, which should get a value close to zero, and closer as N increases. Average: 0.0014 0.0338 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.9372 -0.3488 Average |(XdotV)| 0.6447 V: 0.9256 0.3784 Average |(XdotV)| 0.6335 V: -0.6933 0.7206 Average |(XdotV)| 0.6524 V: -0.9996 -0.0287 Average |(XdotV)| 0.6302 V: 0.9937 0.1123 Average |(XdotV)| 0.6177 TEST191 For the unit sphere in 3 dimensions: SPHERE_UNIT_SAMPLE_3D samples; A few sample values: -0.7796 -0.2177 -0.5872 0.4056 -0.3498 -0.8445 -0.8049 -0.5225 -0.2813 0.4119 0.3845 -0.8262 -0.9390 0.1669 -0.3008 Now average the points, which should get a value close to zero, and closer as N increases. Average: 0.0065 0.0114 -0.0069 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.7086 -0.6583 0.2541 Average |(XdotV)| 0.5041 V: 0.3793 -0.3777 -0.8447 Average |(XdotV)| 0.5181 V: -0.4586 -0.7312 0.5050 Average |(XdotV)| 0.5017 V: -0.7499 -0.5599 0.3523 Average |(XdotV)| 0.5132 V: -0.7436 -0.4550 0.4899 Average |(XdotV)| 0.5124 TEST192 For the unit sphere in 3 dimensions: SPHERE_UNIT_SAMPLE2_3D samples; Warning: SPHERE_UNIT_SAMPLE2_3D is NOT a good code! I only implemented it for comparison. A few sample values: 0.2121 -0.0317 -0.9767 0.0998 0.0751 0.9922 -0.1357 0.1063 -0.9850 -0.7230 -0.5397 -0.4314 0.9988 0.0259 0.0410 Now average the points, which should get a value close to zero, and closer as N increases. Average: -0.0100 0.0046 -0.0047 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.7185 0.6749 0.1683 Average |(XdotV)| 0.4168 V: 0.0634 -0.5901 -0.8048 Average |(XdotV)| 0.5767 V: -0.8828 -0.4681 0.0395 Average |(XdotV)| 0.4251 V: 0.4468 -0.4140 -0.7931 Average |(XdotV)| 0.5589 V: 0.8092 -0.2468 -0.5332 Average |(XdotV)| 0.4967 TEST193 For the unit sphere in N dimensions: SPHERE_UNIT_SAMPLE_ND samples; A few sample values: 0.7638 -0.0581 0.6429 -0.5671 -0.5066 -0.6494 0.2180 0.5211 0.8252 -0.4723 -0.6424 -0.6036 -0.0883 0.0143 0.9960 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.0004 0.0055 0.0165 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.9655 -0.1155 -0.2333 Average |(XdotV)| 0.5094 V: 0.1599 0.4957 0.8536 Average |(XdotV)| 0.5352 V: -0.9300 0.0782 -0.3590 Average |(XdotV)| 0.5075 V: 0.3117 -0.7149 -0.6259 Average |(XdotV)| 0.4726 V: -0.9747 0.0110 -0.2234 Average |(XdotV)| 0.5211 TEST194 For the unit sphere in N dimensions: SPHERE_UNIT_SAMPLE2_ND samples; A few sample values: -0.0315 -0.2477 0.9683 -0.0275 -0.1358 0.9903 -0.7814 0.5883 0.2080 -0.0777 0.8170 -0.5714 -0.5249 0.7946 0.3051 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.0155 -0.0121 -0.0105 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.5699 -0.7935 -0.2133 Average |(XdotV)| 0.4874 V: 0.1953 0.9742 -0.1133 Average |(XdotV)| 0.4968 V: -0.5043 -0.7326 0.4572 Average |(XdotV)| 0.4955 V: -0.1392 0.7434 0.6543 Average |(XdotV)| 0.5107 V: 0.1113 -0.6525 0.7496 Average |(XdotV)| 0.5121 TEST195 For the unit sphere in N dimensions: SPHERE_UNIT_SAMPLE3_ND samples; A few sample values: 0.7496 -0.6358 0.1840 0.4821 -0.2807 0.8299 -0.2399 0.9192 0.3121 -0.4575 -0.8888 -0.0282 0.0527 0.2942 0.9543 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.0022 0.0241 -0.0217 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.2910 -0.9163 -0.2750 Average |(XdotV)| 0.4979 V: 0.2852 0.9584 0.0142 Average |(XdotV)| 0.4840 V: 0.5933 0.7720 0.2279 Average |(XdotV)| 0.4918 V: 0.3977 0.7560 -0.5199 Average |(XdotV)| 0.5105 V: -0.3280 0.7587 0.5628 Average |(XdotV)| 0.5023 TEST196 For a shape in 2D, SHAPE_POINT_DIST_2D computes the distance to a point; Number of sides: 4 Square center: 3.00000 0.00000 Square vertex #1: 5.00000 0.00000 I X Y DIST 1 3.00000 0.00000 2.00000 2 5.00000 0.00000 0.00000 3 4.00000 0.00000 0.707107 4 10.0000 0.00000 5.00000 5 8.00000 5.00000 5.65685 6 6.00000 6.00000 5.00000 7 1.00000 2.00000 1.41421 8 2.50000 -0.500000 0.707107 9 4.00000 -1.00000 0.00000 TEST197 For a shape in 2D, SHAPE_POINT_DIST_2D computes the distance to a point; Number of sides: 6 Hexagon center: 3.00000 0.00000 Hexagon vertex #1: 5.00000 0.00000 I X Y DIST 1 3.00000 0.00000 2.00000 2 5.00000 0.00000 0.00000 3 4.00000 0.00000 0.866025 4 10.0000 0.00000 5.00000 5 4.00000 1.73205 0.00000 6 5.00000 3.46410 2.00000 7 3.00000 1.73205 0.119209E-06 8 3.00000 0.866025 0.866025 TEST198 For a shape in 2D, SHAPE_POINT_NEAR_2D computes the nearest point to a point; Number of sides: 6 Hexagon center: 3.00000 0.00000 Hexagon vertex #1: 5.00000 0.00000 I X Y Xnear Ynear Dist 1 3.0000 0.0000 0.0000 0.0000 2.0000 2 5.0000 0.0000 5.0000 0.0000 0.0000 3 4.0000 0.0000 4.7500 0.4330 0.8660 4 10.0000 0.0000 5.0000 0.0000 5.0000 5 4.0000 1.7321 4.0000 1.7321 0.0000 6 5.0000 3.4641 4.0000 1.7321 2.0000 7 3.0000 1.7321 3.0000 1.7321 0.0000 8 3.0000 0.8660 3.0000 1.7321 0.8660 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: 3.00000 0.00000 Hexagon vertex #1: 5.00000 0.00000 I XA YA XB YB XI YI 1 3.0000 0.0000 4.0000 0.0000 5.0000 0.0000 2 3.0000 0.0000 3.0000 1.0000 3.0000 1.7321 3 3.0000 -1.0000 3.0000 1.0000 3.0000 1.7321 4 3.0000 -1.0000 7.0000 5.0000 4.3812 1.0718 TEST200 STRI_SIDES_TO_ANGLES_3D takes the sides of a spherical triangle and determines the angles. A = 2.0589 (radians) = 117.9644 ( degrees ) Correct = 117.9667 (degrees) B = 1.6271 (radians) = 93.2280 ( degrees ) Correct = 93.2300 (degrees) C = 1.2277 (radians) = 70.3443 ( degrees ) Correct = 70.3433 (degrees) TEST201 STRING_2D takes a set of line segments, and "strings" them together. I, (X1,Y1), (X2,Y2) 1 0.00000 0.00000 1.00000 1.00000 2 3.00000 4.00000 2.00000 4.00000 3 2.00000 2.00000 1.00000 3.00000 4 3.00000 2.00000 2.00000 3.00000 5 2.00000 1.00000 2.00000 2.00000 6 1.00000 1.00000 1.00000 2.00000 7 0.00000 5.00000 1.00000 6.00000 8 1.00000 2.00000 1.00000 3.00000 9 3.00000 2.00000 3.00000 3.00000 10 0.00000 0.00000 1.00000 0.00000 11 5.00000 5.00000 6.00000 6.00000 12 3.00000 3.00000 3.00000 4.00000 13 2.00000 4.00000 2.00000 3.00000 14 7.00000 4.00000 5.00000 5.00000 15 1.00000 0.00000 2.00000 1.00000 Found 4 groups of segments. ISTRNG, IORDER, (X1,Y1), (X2,Y2) 1 -3 2.0000 2.0000 2.0000 1.0000 1 -2 2.0000 1.0000 1.0000 0.0000 1 -1 1.0000 0.0000 0.0000 0.0000 1 0 0.0000 0.0000 1.0000 1.0000 1 1 1.0000 1.0000 1.0000 2.0000 1 2 1.0000 2.0000 1.0000 3.0000 1 3 1.0000 3.0000 2.0000 2.0000 2 -2 3.0000 2.0000 3.0000 3.0000 2 -1 3.0000 3.0000 3.0000 4.0000 2 0 3.0000 4.0000 2.0000 4.0000 2 1 2.0000 4.0000 2.0000 3.0000 2 2 2.0000 3.0000 3.0000 2.0000 3 0 0.0000 5.0000 1.0000 6.0000 4 -1 7.0000 4.0000 5.0000 5.0000 4 0 5.0000 5.0000 6.0000 6.0000 TEST202 SUPER_ELLIPSE_POINTS_2D returns points on a super ellipse; The super ellipse will have center 5.00000 -2.00000 radii R1 = 3.00000 R2 = 1.00000 exponent EXPO = 1.50000 and angle PSI = 0.523599 and area = 9.42478 Sample points: 1 7.59808 -0.500000 2 7.40059 -0.461978 3 6.91708 -0.484923 4 6.24752 -0.593153 5 5.51559 -0.771716 6 4.86743 -0.980351 7 4.50000 -1.13397 8 4.18324 -1.37537 9 3.67848 -1.83238 10 3.15787 -2.37696 11 2.72936 -2.90271 12 2.46774 -3.30996 13 2.40192 -3.50000 14 2.59941 -3.53802 15 3.08292 -3.51508 16 3.75248 -3.40685 17 4.48441 -3.22828 18 5.13257 -3.01965 19 5.50000 -2.86603 20 5.81676 -2.62463 21 6.32152 -2.16762 22 6.84213 -1.62304 23 7.27064 -1.09729 24 7.53226 -0.690042 TEST203 For a tetrahedron in 3D, TETRA_CENTROID_3D computes the centroid; TETRA_CONTAINS_POINT_3D finds if a point is inside; TETRA_CIRCUMSPHERE_3D computes the circumsphere; TETRA_VOLUME_3D computes the volume; Corners: 0.00000 0.942809 -0.333333 -0.816497 -0.471405 -0.333333 0.816497 -0.471405 -0.333333 0.00000 0.00000 1.00000 Volume: 0.513200 Centroid: 0.00000 0.00000 0.00000 Circumcircle center: 0.00000 0.596046E-07 0.596046E-07 Circumcircle radius is 1.00000 X, Y, Z, Inside_Tetra? 0.816497E-01 -0.141421 0.600000 F -1.46969 -2.26274 -0.200000 F -0.898146 0.707107 -0.200000 F 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: 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 Transformation matrix for rotation about x by 30.0000 1.00000 0.00000 0.00000 0.00000 0.00000 0.866025 -0.500000 0.00000 0.00000 0.500000 0.866025 0.00000 0.00000 0.00000 0.00000 1.00000 Transformation matrix for rotation about 1.00000 2.00000 3.00000 of 30.0000 0.875595 -0.381753 0.295970 0.00000 0.420031 0.904304 -0.762129E-01 0.00000 -0.238552 0.191048 0.952152 0.00000 0.00000 0.00000 0.00000 1.00000 Transformation matrix for scaling by 2.00000 0.500000 10.0000 2.00000 0.00000 0.00000 0.00000 0.00000 0.500000 0.00000 0.00000 0.00000 0.00000 10.0000 0.00000 0.00000 0.00000 0.00000 1.00000 Transformation matrix for xy shear coefficient of 0.500000 1.00000 0.500000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 Transformation matrix for translation by 1.00000 2.00000 3.00000 1.00000 0.00000 0.00000 1.00000 0.00000 1.00000 0.00000 2.00000 0.00000 0.00000 1.00000 3.00000 0.00000 0.00000 0.00000 1.00000 TEST205 TMAT_MXP2 applies a geometric transformation matrix to a set of points. Points as column vectors: 1.00000 0.00000 0.00000 1.00000 0.00000 1.00000 0.00000 1.00000 0.00000 0.00000 1.00000 1.00000 Initial transformation matrix: 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 Rotation about x by 30.0000 1.00000 0.00000 0.00000 1.00000 0.00000 0.866025 -0.500000 0.366025 0.00000 0.500000 0.866025 1.36603 Rotation about 0.00000 0.00000 0.00000 of 30.0000 0.875595 -0.381753 0.295970 0.789812 0.420031 0.904304 -0.762129E-01 1.24812 -0.238552 0.191048 0.952152 0.904648 Scaling by 2.00000 0.500000 10.0000 2.00000 0.00000 0.00000 2.00000 0.00000 0.500000 0.00000 0.500000 0.00000 0.00000 10.0000 10.0000 xy shear coefficient of 0.500000 1.00000 0.500000 0.00000 1.50000 0.00000 1.00000 0.00000 1.00000 0.00000 0.00000 1.00000 1.00000 Translation by 1.00000 2.00000 3.00000 2.00000 1.00000 1.00000 2.00000 2.00000 3.00000 2.00000 3.00000 3.00000 3.00000 4.00000 4.00000 TEST206 For a triangle in 2D, TRIANGLE_ANGLES_2D computes the angles; TRIANGLE_AREA_2D computes the area; TRIANGLE_AREA_SIGNED_2D computes signed area. TRIANGLE_CENTROID_2D computes the centroid. TRIANGLE_CIRCUMCIRCLE_2D computes the circumcircle. TRIANGLE_INCENTER_2D computes the incircle. The corners of the triangle are: 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 Angles in radians: 0.785398 1.57080 0.785398 Angles in degrees: 45.0000 90.0000 45.0000 Area is 0.500000 Signed area is 0.500000 Centroid is 0.333333 0.333333 Incircle center is 0.292893 0.292893 Incircle radius is 0.292893 Circumcircle center is 0.500000 0.500000 Circumcircle radius is 0.707107 TEST207 For a triangle in 2D, TRIANGLE_CONTAINS_POINT_1_2D reports if a point is inside a triangle; TRIANGLE_CONTAINS_POINT_2_2D reports if a point is inside a triangle; TRIANGLE_POINT_DIST_2D computes the distance to a point; TRIANGLE_POINT_DIST_SIGNED_2D computes signed distance to a point; TRIANGLE_POINT_NEAR_2D computes the nearest point to a point. The corners of the triangle are: 0.000 1.000 0.000 0.000 1.000 0.000 X Y In1 In2 DIST_S DIST XN YN 0.250 0.250 T T -0.250 0.250 0.000 0.250 0.750 0.250 T T 0.000 0.000 0.750 0.250 1.000 1.000 F F 0.707 0.707 0.500 0.500 11.000 0.500 F F 10.012 10.012 1.000 0.000 0.000 1.000 T T 0.000 0.000 0.000 1.000 0.500 -10.000 F F 10.000 10.000 0.500 0.000 0.600 0.600 F F 0.141 0.141 0.500 0.500 TEST208 For a triangle in 2D, TRIANGLE_GRIDPOINTS_2D produces a set of gridpoints in or on the triangle. Vertex A : ( 0.00000 , 1.00000 ) Vertex B : ( 0.00000 , 0.00000 ) Vertex C : ( 1.00000 , 0.00000 ) Number of grid points is 10 ( 1.00000 , 0.00000 ) ( 0.666667 , 0.00000 ) ( 0.333333 , 0.00000 ) ( 0.00000 , 0.00000 ) ( 0.666667 , 0.333333 ) ( 0.333333 , 0.333333 ) ( 0.00000 , 0.333333 ) ( 0.333333 , 0.666667 ) ( 0.00000 , 0.666667 ) ( 0.00000 , 1.00000 ) TEST209 For a triangle in 3D: TRIANGLE_ANGLES_3D computes the angles; TRIANGLE_AREA_3D computes the area; TRIANGLE_AREA_2_3D computes the area; TRIANGLE_CENTROID_3D computes the centroid. Vertex A : ( 1.00000 , 2.00000 , 3.00000 ) Vertex B : ( 2.41421 , 3.41421 , 3.00000 ) Vertex C : ( 1.70711 , 2.70711 , 4.00000 ) Angles in radians: 0.785398 0.785398 1.57080 Angles in degrees: 45.0000 45.0000 90.0000 Area is 1.00000 Second area calculation is 1.00000 Centroid : ( 1.70711 , 2.70711 , 3.33333 ) X Y Z DIST 1.000 2.000 3.000 0.00000 1.354 2.354 3.000 0.00000 0.000 0.000 0.000 3.74166 TEST210 For a triangle in 2D: TRIANGLE_CENTROID_2D computes the centroid. TRIANGLE_CIRCUMCENTER_2D computes the circumcenter. TRIANGLE_INCENTER_2D computes the incenter. TRIANGLE_ORTHOCENTER_2D computes the orthocenter. Vertex A : ( 0.00000 , 0.00000 ) Vertex B : ( 1.00000 , 0.00000 ) Vertex C : ( 0.00000 , 1.00000 ) Centroid : ( 0.333333 , 0.333333 ) Circumcenter : ( 0.500000 , 0.500000 ) Incenter : ( 0.292893 , 0.292893 ) Orthocenter : ( 0.00000 , 0.00000 ) Vertex A : ( 0.00000 , 0.00000 ) Vertex B : ( 1.00000 , 0.00000 ) Vertex C : ( 0.500000 , 0.866025 ) Centroid : ( 0.500000 , 0.288675 ) Circumcenter : ( 0.500000 , 0.288675 ) Incenter : ( 0.500000 , 0.288675 ) Orthocenter : ( 0.500000 , 0.288675 ) Vertex A : ( 0.00000 , 0.00000 ) Vertex B : ( 1.00000 , 0.00000 ) Vertex C : ( 0.500000 , 10.0000 ) Centroid : ( 0.500000 , 3.33333 ) Circumcenter : ( 0.500000 , 4.98750 ) Incenter : ( 0.500000 , 0.475625 ) Orthocenter : ( 0.500000 , 0.250000E-01) Vertex A : ( 0.00000 , 0.00000 ) Vertex B : ( 1.00000 , 0.00000 ) Vertex C : ( 10.0000 , 2.00000 ) Centroid : ( 3.66667 , 0.666667 ) Circumcenter : ( 0.500000 , 23.5000 ) Incenter : ( 0.989247 , 0.979548E-01) Orthocenter : ( 10.0003 , -45.0015 ) TEST211 TRIANGLE_ORIENTATION_2D determines orientation of a triangle. Triangle vertices: 4.00000 2.00000 1.00000 5.00000 -2.00000 2.00000 TRIANGLE_ORIENTATION_2D = 0 These points are Counterclockwise Triangle vertices: 1.00000 5.00000 4.00000 2.00000 1.00000 -1.00000 TRIANGLE_ORIENTATION_2D = 1 These points are Clockwise Triangle vertices: 1.00000 5.00000 2.00000 7.00000 3.00000 9.00000 TRIANGLE_ORIENTATION_2D = 2 The points are Colinear Triangle vertices: 1.00000 5.00000 4.00000 2.00000 1.00000 5.00000 TRIANGLE_ORIENTATION_2D = 3 The points are Nondistinct TEST212 TRIANGLE_SAMPLE_2D 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: 4.00000 2.00000 1.00000 5.00000 -2.00000 2.00000 Sample points (X,Y) and (XSI1,XSI2,XSI3) coordinates: 3.8802 2.0763 0.9673 0.0254 0.0073 3.1610 2.3427 0.8031 0.1142 0.0827 3.4921 2.0024 0.9149 0.0008 0.0843 3.8357 2.0614 0.9624 0.0205 0.0171 2.6391 2.5533 0.6810 0.1844 0.1346 -0.1263 2.4279 0.2410 0.1426 0.6164 2.9270 2.8877 0.6732 0.2959 0.0309 1.3340 2.9397 0.3990 0.3132 0.2877 1.9245 2.4094 0.5859 0.1365 0.2777 3.2919 2.0586 0.8722 0.0195 0.1083 TEST213 TRIANGLE_SAMPLE_2D 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: 4.00000 2.00000 1.00000 5.00000 -2.00000 2.00000 Sample points: 1.0000 3.0000 0.3333 0.3333 0.3333 1.0000 3.0000 3.0000 0.0000 1.1667 -0.6667 0.5000 3.0000 0.0000 2.8674 2.0512 0.8027 0.0171 0.1802 2.8674 2.0512 2.5048 2.4824 0.6704 0.1608 0.1688 2.5048 2.4824 3.4191 2.0284 0.8985 0.0095 0.0921 3.4191 2.0284 3.1543 2.5816 0.7621 0.1939 0.0440 3.1543 2.5816 0.1690 2.5160 0.2755 0.1720 0.5525 0.1690 2.5160 3.7901 2.1502 0.9400 0.0501 0.0099 3.7901 2.1502 1.7786 2.9761 0.4671 0.3254 0.2076 1.7786 2.9761 3.6934 2.0249 0.9447 0.0083 0.0469 3.6934 2.0249 TEST214 TRIANGULATION_BOUNDARY_COUNT determines the number of edges that lie on the convex hull of a region that has been triangulated. Number of points = 13 Number of triangles = 16 Number of boundary edges = 8 TEST215 For a triangulation of a set of nodes, TRIANGULATION_CHECK checks the triangulation. Triangle Nodes 1 3 4 1 2 3 1 2 3 3 2 8 4 2 1 5 5 8 2 13 6 8 13 9 7 3 8 9 8 13 2 5 9 9 13 7 10 7 13 5 11 6 7 5 12 9 7 6 13 10 9 6 14 6 5 12 15 11 6 12 16 10 6 11 Error code = 0 TRIANGULATION_CHECK - Fatal error! The number of nodes is less than 3! Error code = 1 TRIANGULATION_CHECK - Fatal error! The number of triangles is less than 1! Error code = 2 TRIANGULATION_CHECK - Fatal error! Some vertices are less than 1! Error code = 3 TRIANGULATION_CHECK - Fatal error! Some vertices are greater than POINT_NUM! Error code = 4 TRIANGULATION_CHECK - Fatal error! Some nodes are never used as triangle vertices! Error code = 5 TRIANGULATION_CHECK - Fatal error! A triangle contains a null edge! Error code = 6 TRIANGULATION_EDGE_CHECK - Fatal error! An edge occurs twice. TRIANGULATION_CHECK - Fatal error! Some edges are repeated or given in the wrong direction! Error code = 7 TEST216 For a triangulation of a set of nodes, TRIANGULATION_NEIGHBOR determines triangle neighbors. T1 S1 T2 S2 1 1 0 0 1 2 0 0 1 3 2 1 2 1 1 3 2 2 4 1 2 3 3 1 3 1 2 3 3 2 5 1 3 3 7 1 4 1 2 2 4 2 0 0 4 3 8 2 5 1 3 2 5 2 8 1 5 3 6 1 6 1 5 3 6 2 9 1 6 3 7 2 7 1 3 3 7 2 6 3 7 3 0 0 8 1 5 2 8 2 4 3 8 3 10 2 9 1 6 2 9 2 10 1 9 3 12 1 10 1 9 2 10 2 8 3 10 3 11 2 11 1 12 2 11 2 10 3 11 3 14 1 12 1 9 3 12 2 11 1 12 3 13 2 13 1 0 0 13 2 12 3 13 3 16 1 14 1 11 3 14 2 0 0 14 3 15 2 15 1 16 2 15 2 14 3 15 3 0 0 16 1 13 3 16 2 15 1 16 3 0 0 TEST217 For a triangulation of a set of nodes, TRIANGULATION_NABE_NODES determines the adjacency relationships between triangles. Triangle Nodes 1 3 4 1 2 3 1 2 3 3 2 8 4 2 1 5 5 8 2 13 6 8 13 9 7 3 8 9 8 13 2 5 9 9 13 7 10 7 13 5 11 6 7 5 12 9 7 6 13 10 9 6 14 6 5 12 15 11 6 12 16 10 6 11 Triangle Neighbors 1 -1 -1 2 2 1 4 3 3 2 5 7 4 2 -1 8 5 3 8 6 6 5 9 7 7 3 6 -1 8 5 4 10 9 6 10 12 10 9 8 11 11 12 10 14 12 9 11 13 13 -1 12 16 14 11 -1 15 15 16 14 -1 16 13 15 -1 TEST218 Given a point set XC, and a single point XD, find the nearest point in XC to XD. POINTS_NEAREST_POINT_NAIVE_2D uses a naive method. TRIANGULATION_SEARCH_2D finds a triangle containing the point. Often, one of these vertices is the closest point. RANDOM_INITIALIZE Initialize RANDOM_NUMBER with arbitrary SEED = 1569960352 X Y Distance Index XD 4.7937 1.7538 Naive 6.0000 4.0000 2.5496 6 Delaunay 2.0000 2.0000 2.5496 4 XD 5.7650 1.9733 Naive 6.0000 4.0000 2.0403 6 Delaunay 8.0000 2.0000 2.2352 9 XD -0.1130 3.3220 Naive -1.0000 3.0000 0.9437 2 Delaunay -1.0000 3.0000 0.9437 2 XD 0.8796 2.9881 Naive 2.0000 2.0000 1.4939 4 Delaunay 2.0000 2.0000 1.4939 4 XD 1.9415 3.9603 Naive 2.0000 2.0000 1.9612 4 Delaunay 2.0000 2.0000 1.9612 4 XD 0.0196 2.7440 Naive -1.0000 3.0000 1.0512 2 Delaunay -1.0000 3.0000 1.0512 2 XD 6.4268 6.3138 Naive 6.0000 7.0000 0.8081 7 Delaunay 6.0000 7.0000 0.8081 7 XD 4.9957 5.8983 Naive 5.0000 6.0000 0.1018 5 Delaunay 5.0000 6.0000 0.1018 5 XD 0.1842 3.5768 Naive -1.0000 3.0000 1.3172 2 Delaunay -1.0000 3.0000 1.3172 2 XD 6.5836 5.7652 Naive 6.0000 7.0000 1.3658 7 Delaunay 6.0000 7.0000 1.3658 7 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: 0.00000 0.00000 4.00000 3.00000 4.00000 0.00000 0.00000 0.00000 X1, Y1 -0.100000E+00 -0.700000 3.50000 2.00000 3.50000 0.500000 -0.500000 0.500000 X2, Y2 -0.700000 0.100000E+00 4.50000 4.00000 4.50000 -0.500000 -0.500000 -0.500000 Test number 2 Number of points N = 5 Tube radius DIST = 0.500000 Points to surround: 0.00000 0.00000 2.00000 0.00000 2.00000 1.00000 0.00000 1.00000 0.00000 0.00000 X1, Y1 -0.500000 -0.500000 2.50000 -0.500000 2.50000 1.50000 -0.500000 1.50000 -0.500000 -0.500000 X2, Y2 -0.500000 0.500000 1.50000 0.500000 1.50000 0.500000 0.500000 0.500000 0.500000 -0.500000 Test number 3 Number of points N = 5 Tube radius DIST = 1.00000 Points to surround: 10.0000 20.0000 20.0000 20.0000 10.0000 10.0000 20.0000 10.0000 10.0000 20.0000 X1, Y1 9.00000 19.0000 17.5858 19.0000 7.58579 9.00000 22.4142 9.00000 10.0000 21.4142 X2, Y2 9.00000 21.0000 22.4142 21.0000 12.4142 11.0000 17.5858 11.0000 8.58579 20.0000 Test number 4 Number of points N = 5 Tube radius DIST = 1.00000 Points to surround: 0.00000 0.00000 10.0000 0.00000 10.0000 10.0000 10.0000 0.00000 0.00000 0.00000 X1, Y1 -1.00000 -1.00000 11.0000 -1.00000 11.0000 11.0000 11.0000 -1.00000 -1.00000 -1.00000 X2, Y2 -1.00000 1.00000 9.00000 1.00000 9.00000 11.0000 9.00000 1.00000 -1.00000 1.00000 TEST220 VECTOR_DIRECTIONS_2D computes the angles that a vector makes with the X, Y and Z axes. X Y AX AY AX AY (__Radians___) (___Degrees___) 1.000 0.000 0.000 1.571 0.000 90.000 1.732 1.000 0.524 1.047 30.000 60.000 -1.732 1.000 2.618 -1.047 150.000 -60.000 -1.732 -1.000 -2.618 -2.094 -150.000 -120.000 1.732 -1.000 -0.524 2.094 -30.000 120.000 TEST221 VECTOR_DIRECTIONS_3D computes the angles that a vector makes with the X, Y and Z axes. X Y Z AX AY AZ AX AY AZ (_____Radians_______) (_______Degrees_______) 1.000 0.000 0.000 0.000 1.571 1.571 0.000 90.000 90.000 1.000 2.000 3.000 1.300 1.007 0.641 74.499 57.688 36.699 0.000 0.000 1.000 1.571 1.571 0.000 90.000 90.000 0.000 TEST222 VECTOR_ROTATE_2D rotates a vector through a given angle around the origin. X1 Y1 Angle X2 Y2 1.000 0.000 30.000 0.866 0.500 0.000 2.000 -45.000 1.414 1.414 1.000 1.000 270.000 1.000 -1.000 TEST223 VECTOR_ROTATE_BASE_2D rotates a vector (X1,Y1) through an angle around a base point (XB,YB). X1 Y1 XB YB Angle X2 Y2 11.000 5.000 10.000 5.000 30.000 10.866 5.500 10.000 7.000 10.000 5.000 -45.000 11.414 6.414 11.000 6.000 10.000 5.000 270.000 11.000 4.000 10.000 5.000 10.000 5.000 20.000 10.000 5.000 TEST224 VECTOR_SEPARATION_3D computes the separation angle between two vectors. -----Vector 1----- -----Vector 2----- Radians Degrees 1.000 0.000 0.000 1.000 2.000 3.000 1.300 74.499 1.000 0.000 0.000 0.000 0.000 1.000 1.571 90.000 1.000 0.000 0.000 -3.000 2.000 -1.000 2.501 143.301 1.000 0.000 0.000 -2.000 -4.000 -6.000 1.841 105.501 1.000 2.000 3.000 0.000 0.000 1.000 0.641 36.699 1.000 2.000 3.000 -3.000 2.000 -1.000 1.714 98.213 1.000 2.000 3.000 -2.000 -4.000 -6.000 3.141 179.980 0.000 0.000 1.000 -3.000 2.000 -1.000 1.841 105.501 0.000 0.000 1.000 -2.000 -4.000 -6.000 2.501 143.301 -3.000 2.000 -1.000 -2.000 -4.000 -6.000 1.427 81.787 TEST225 VOXEL_LINE_3D prints the voxels on a line in 3D. Start: 0 0 0 End: 4 2 7 0 0 0 0 1 0 0 1 2 0 0 2 3 0 0 3 4 0 1 3 5 1 1 3 6 2 1 3 7 2 1 4 8 2 1 5 9 2 1 6 10 2 2 6 11 3 2 6 12 4 2 6 13 4 2 7 TEST226 VOXEL_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 includes 1 voxels: 8 8 1 Region 2 includes 3 voxels: 7 3 1 6 3 1 6 2 1 Region 1 includes 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 VOXEL_STEP_3D steps along a line from one voxel to another. 1 1 5 2 1 5 2 2 5 3 2 5 4 2 5 5 3 4 6 3 4 7 3 4 7 4 4 8 4 4 9 4 4 9 4 4 8 4 4 8 3 4 7 3 4 6 3 4 5 2 5 4 2 5 3 2 5 3 1 5 2 1 5 1 1 5 GEOMETRY_PRB Normal end of execution.