Tue Oct 19 17:25:30 2021 triangle_integrals_test(): Python version: 3.6.9 Test triangle_integrals(). i4_to_pascal_test Python version: 3.6.9 i4_to_pascal converts a linear index to Pascal triangle indices. K => I J 1 0 0 2 1 0 3 0 1 4 2 0 5 1 1 6 0 2 7 3 0 8 2 1 9 1 2 10 0 3 11 4 0 12 3 1 13 2 2 14 1 3 15 0 4 16 5 0 17 4 1 18 3 2 19 2 3 20 1 4 i4_to_pascal_test: Normal end of execution. i4_to_pascal_degree_test Python version: 3.6.9 i4_to_pascal_degree converts a linear index to the degree of the corresponding Pascal triangle indices. K => D 1 0 2 1 3 1 4 2 5 2 6 2 7 3 8 3 9 3 10 3 11 4 12 4 13 4 14 4 15 4 16 5 17 5 18 5 19 5 20 5 i4_to_pascal_degree_test: Normal end of execution. pascal_to_i4_test Python version: 3.6.9 pascal_to_i4 converts Pascal triangle indices to a linear index. I J => K 0 0 1 1 0 2 0 1 3 2 0 4 1 1 5 0 2 6 3 0 7 2 1 8 1 2 9 0 3 10 4 0 11 3 1 12 2 2 13 1 3 14 0 4 15 pascal_to_i4_test: Normal end of execution. r8mat_print_test Python version: 3.6.9 r8mat_print prints an R8MAT. Here is an R8MAT: Col: 0 1 2 3 4 Row 0 : 11 12 13 14 15 1 : 21 22 23 24 25 2 : 31 32 33 34 35 3 : 41 42 43 44 45 Col: 5 Row 0 : 16 1 : 26 2 : 36 3 : 46 r8mat_print_test: Normal end of execution. r8mat_print_some_test Python version: 3.6.9 r8mat_print_some prints some of an R8MAT. Here is an R8MAT: Col: 3 4 5 Row 0 : 14 15 16 1 : 24 25 26 2 : 34 35 36 r8mat_print_some_test: Normal end of execution. trinomial_test Python version: 3.6.9 trinomial evaluates the trinomial coefficient: T(I,J,K) = (I+J+K)! / I! / J! / K! I J K T(I,J,K) 0 0 0 1 1 0 0 1 2 0 0 1 3 0 0 1 4 0 0 1 0 1 0 1 1 1 0 2 2 1 0 3 3 1 0 4 4 1 0 5 0 2 0 1 1 2 0 3 2 2 0 6 3 2 0 10 4 2 0 15 0 3 0 1 1 3 0 4 2 3 0 10 3 3 0 20 4 3 0 35 0 4 0 1 1 4 0 5 2 4 0 15 3 4 0 35 4 4 0 70 0 0 1 1 1 0 1 2 2 0 1 3 3 0 1 4 4 0 1 5 0 1 1 2 1 1 1 6 2 1 1 12 3 1 1 20 4 1 1 30 0 2 1 3 1 2 1 12 2 2 1 30 3 2 1 60 4 2 1 105 0 3 1 4 1 3 1 20 2 3 1 60 3 3 1 140 4 3 1 280 0 4 1 5 1 4 1 30 2 4 1 105 3 4 1 280 4 4 1 630 0 0 2 1 1 0 2 3 2 0 2 6 3 0 2 10 4 0 2 15 0 1 2 3 1 1 2 12 2 1 2 30 3 1 2 60 4 1 2 105 0 2 2 6 1 2 2 30 2 2 2 90 3 2 2 210 4 2 2 420 0 3 2 10 1 3 2 60 2 3 2 210 3 3 2 560 4 3 2 1260 0 4 2 15 1 4 2 105 2 4 2 420 3 4 2 1260 4 4 2 3150 0 0 3 1 1 0 3 4 2 0 3 10 3 0 3 20 4 0 3 35 0 1 3 4 1 1 3 20 2 1 3 60 3 1 3 140 4 1 3 280 0 2 3 10 1 2 3 60 2 2 3 210 3 2 3 560 4 2 3 1260 0 3 3 20 1 3 3 140 2 3 3 560 3 3 3 1680 4 3 3 4200 0 4 3 35 1 4 3 280 2 4 3 1260 3 4 3 4200 4 4 3 11550 0 0 4 1 1 0 4 5 2 0 4 15 3 0 4 35 4 0 4 70 0 1 4 5 1 1 4 30 2 1 4 105 3 1 4 280 4 1 4 630 0 2 4 15 1 2 4 105 2 2 4 420 3 2 4 1260 4 2 4 3150 0 3 4 35 1 3 4 280 2 3 4 1260 3 3 4 4200 4 3 4 11550 0 4 4 70 1 4 4 630 2 4 4 3150 3 4 4 11550 4 4 4 34650 trinomial_test Normal end of execution. rs_to_xy_map_test: Python version: 3.6.9 rs_to_xy_map determines the coefficients of the linear map from a the reference in RS coordinates to the physical triangle in XY coordinates: X = a + b * R + c * S Y = d + e * R + f * S XY triangle vertices: Col: 0 1 Row 0 : 2 0 1 : 3 4 2 : 0 3 Mapping coefficients are: X = 2 + 1 * R + -2 * S Y = 0 + 4 * R + 3 * S Apply map to RS triangle vertices. Recover XY vertices (2,0), (3,4) and (0,3). V(0) = ( 2, 0 ) V(1) = ( 3, 4 ) V(2) = ( 0, 3 ) rs_to_xy_map_test: Normal end of execution. xy_to_rs_map_test: Python version: 3.6.9 xy_to_rs_map determines the coefficients of the linear map from a general triangle in XY coordinates to the reference triangle in RS coordinates: R = a + b * X + c * Y S = d + e * X + f * Y XY triangle vertices: Col: 0 1 Row 0 : 2 0 1 : 3 4 2 : 0 3 Mapping coefficients are: R = -0.545455 + 0.272727 * X + 0.181818 * Y S = 0.727273 + -0.363636 * X + 0.0909091 * Y Apply map to XY triangle vertices. Recover RS vertices (0,0), (1,0) and (0,1). V(0) = (0,0) V(1) = (1,1.11022e-16) V(2) = (0,1) xy_to_rs_map_test: Normal end of execution. poly_print_test: Python version: 3.6.9 poly_print can print a D-degree polynomial in X and Y. p1(x,y) = +12.34 p2(x,y) = +1 +2 x +3 y p3(x,y) = xy = +1 x y p4(x,y) = +1 -2.1 x +3.2 y -4.3 x^2 +5.4 x y -6.5 y^2 +7.6 x^3 -8.7 x^2 y +9.8 x y^2 -10.9 y^3 poly_print_test Normal end of execution. poly_power_linear_test: Python version: 3.6.9 poly_power_linear computes the N-th power of a linear polynomial in X and Y. p1(x,y) = +1 +2 x +3 y p1(x,y)^n = +1 +4 x +6 y +4 x^2 +12 x y +9 y^2 Correct answer: p1(x,y)^2 = +1 +4 x +6 y +4 x^2 +12 x y +9 y^2 p1(x,y) = +2 -1 x +3 y p1(x,y)^3 = +8 -12 x +36 y +6 x^2 -36 x y +54 y^2 -1 x^3 +9 x^2 y -27 x y^2 +27 y^3 Correct answer: p1(x,y)^n = +8 -12 x +36 y +6 x^2 -36 x y +54 y^2 -1 x^3 +9 x^2 y -27 x y^2 +27 y^3 poly_power_linear_test Normal end of execution. poly_power_test: poly_power computes the N-th power of an X,Y polynomial. p1(x,y) = +1 +2 x +3 y p2(x,y) = p1(x,y)^2 = +1 +4 x +6 y +4 x^2 +12 x y +9 y^2 p3(x,y)=correct answer = +1 +4 x +6 y +4 x^2 +12 x y +9 y^2 p1(x,y) = +1 -2 x +3 y -4 x^2 +5 x y -6 y^2 p2(x,y) = p1(x,y)^3 = +1 -6 x +9 y -21 x y +9 y^2 +40 x^3 -96 x^2 y +108 x y^2 -81 y^3 +84 x^3 y -141 x^2 y^2 +171 x y^3 -54 y^4 -96 x^5 +384 x^4 y -798 x^3 y^2 +1017 x^2 y^3 -756 x y^4 +324 y^5 -64 x^6 +240 x^5 y -588 x^4 y^2 +845 x^3 y^3 -882 x^2 y^4 +540 x y^5 -216 y^6 p3(x,y)=correct answer = +1 -6 x +9 y -21 x y +9 y^2 +40 x^3 -96 x^2 y +108 x y^2 -81 y^3 +84 x^3 y -141 x^2 y^2 +171 x y^3 -54 y^4 -96 x^5 +384 x^4 y -798 x^3 y^2 +1017 x^2 y^3 -756 x y^4 +324 y^5 -64 x^6 +240 x^5 y -588 x^4 y^2 +845 x^3 y^3 -882 x^2 y^4 +540 x y^5 -216 y^6 poly_power_test Normal end of execution. poly_product_test: Python version: 3.6.9 poly_product computes the product of two X,Y polynomials. p1(x,y) = +1 +2 x +3 y p2(x,y) = +4 +5 x p3(x,y) = p1(x,y) * p2(x,y) = +4 +13 x +12 y +10 x^2 +15 x y Correct answer: p3(x,y)=p1(x,y)*p2(x,y) = +4 +13 x +12 y +10 x^2 +15 x y p1(x,y) = +1 -2 x +3 y -4 x^2 +5 x y -6 y^2 p2(x,y) = +7 +3 x^2 p3(x,y) = p1(x,y) * p2(x,y) = +7 -14 x +21 y -25 x^2 +35 x y -42 y^2 -6 x^3 +9 x^2 y -12 x^4 +15 x^3 y -18 x^2 y^2 Correct answer: p3(x,y)=p1(x,y)*p2(x,y) = +7 -14 x +21 y -25 x^2 +35 x y -42 y^2 -6 x^3 +9 x^2 y -12 x^4 +15 x^3 y -18 x^2 y^2 poly_product_test Normal end of execution. triangle01_monomial_integral_test Python version: 3.6.9 triangle01_monomial_integral returns the integral Q of a monomial X^I Y^J over the interior of the unit triangle. I J Q(I,J) 0 0 0.5 0 1 0.166667 1 0 0.166667 0 2 0.0833333 1 1 0.0416667 2 0 0.0833333 0 3 0.05 1 2 0.0166667 2 1 0.0166667 3 0 0.05 0 4 0.0333333 1 3 0.00833333 2 2 0.00555556 3 1 0.00833333 4 0 0.0333333 0 5 0.0238095 1 4 0.0047619 2 3 0.00238095 3 2 0.00238095 4 1 0.0047619 5 0 0.0238095 triangle01_monomial_integral_test Normal end of execution. triangle01_poly_integral_test triangle01_poly_integral returns the integral Q of a polynomial P(X,Y) over the interior of the unit triangle. p(x,y) = +1 +2 x +3 y Q = 1.33333 Q (exact) = 0 p(x,y) = +1 x y Q = 0.0416667 Q (exact) = 0 p(x,y) = +1 -2 x +3 y -4 x^2 +5 x y -6 y^2 Q = 0.0416667 Q (exact) = 0 triangle01_poly_integral_test Normal end of execution. triangle_area_test: Python version: 3.6.9 triangle_area determines the (signed) area of a triangle. Triangle vertices are: (X1,Y1) = (0,0) (X2,Y2) = 2*(cos(angle),sin(angle)) (X3,Y3) = (0,1) where angle will sweep from 0 to 360 degrees. I Angle X2 Y2 Area (degrees) 0 0.0000 2.0000 0.0000 1 1 15.0000 1.9319 0.5176 0.965926 2 30.0000 1.7321 1.0000 0.866025 3 45.0000 1.4142 1.4142 0.707107 4 60.0000 1.0000 1.7321 0.5 5 75.0000 0.5176 1.9319 0.258819 6 90.0000 0.0000 2.0000 6.12323e-17 7 105.0000 -0.5176 1.9319 -0.258819 8 120.0000 -1.0000 1.7321 -0.5 9 135.0000 -1.4142 1.4142 -0.707107 10 150.0000 -1.7321 1.0000 -0.866025 11 165.0000 -1.9319 0.5176 -0.965926 12 180.0000 -2.0000 0.0000 -1 13 195.0000 -1.9319 -0.5176 -0.965926 14 210.0000 -1.7321 -1.0000 -0.866025 15 225.0000 -1.4142 -1.4142 -0.707107 16 240.0000 -1.0000 -1.7321 -0.5 17 255.0000 -0.5176 -1.9319 -0.258819 18 270.0000 -0.0000 -2.0000 -1.83697e-16 19 285.0000 0.5176 -1.9319 0.258819 20 300.0000 1.0000 -1.7321 0.5 21 315.0000 1.4142 -1.4142 0.707107 22 330.0000 1.7321 -1.0000 0.866025 23 345.0000 1.9319 -0.5176 0.965926 24 360.0000 2.0000 -0.0000 1 triangle_area_test Normal end of execution. triangle_xy_integral_test Python version: 3.6.9 triangle_xy_integral determines Q, the integral of the monomial X*Y over a triangle (X1,Y1), (X2,Y2), (X3,Y3). ) (X1,Y1) = ( 0,0 ) (X2,Y2) = ( 1,0 ) (X3,Y3) = ( 1,2 ) Q = 0.5 (Expecting answer 1/2. (X1,Y1) = ( 0,0 ) (X2,Y2) = ( 4,0 ) (X3,Y3) = ( 0,1 ) Q = 0.666667 (Expecting answer 2/3. triangle_xy_integral_test Normal end of execution. triangle_monomial_integral_test Python version: 3.6.9 triangle_monomial_integral returns the integral Q of a monomial X^I Y^J over the interior of a triangle. Triangle vertices: (X1,Y1) = (0,0) (X2,Y2) = (1,0) (X3,Y3) = (0,1) Integrand = x^1 * y^0 Computed Q = 0.166667 Exact Q = 0.166667 Triangle vertices: (X1,Y1) = (0,0) (X2,Y2) = (1,0) (X3,Y3) = (1,2) Integrand = x^1 * y^1 Computed Q = 0.5 Exact Q = 0.5 Triangle vertices: (X1,Y1) = (-3,0) (X2,Y2) = (6,0) (X3,Y3) = (0,3) Integrand = x^1 * y^0 Computed Q = 13.5 Exact Q = 13.5 Triangle vertices: (X1,Y1) = (0,0) (X2,Y2) = (4,0) (X3,Y3) = (0,1) Integrand = x^1 * y^1 Computed Q = 0.666667 Exact Q = 0.666667 triangle_monomial_integral_test Normal end of execution. triangle_poly_integral_test Python version: 3.6.9 triangle_poly_integral returns the integral Q of a polynomial over the interior of a triangle. Triangle vertices: (X1,Y1) = (0,0) (X2,Y2) = (1,0) (X3,Y3) = (0,1) Integrand p(x,y) = +1 x Computed Q = 0.166667 Exact Q = 0.166667 Triangle vertices: (X1,Y1) = (0,0) (X2,Y2) = (1,0) (X3,Y3) = (1,2) Integrand p(x,y) = +1 x y Computed Q = 0.5 Exact Q = 0.5 Triangle vertices: (X1,Y1) = (0,0) (X2,Y2) = (1,0) (X3,Y3) = (1,3) Integrand p(x,y) = +2 -3 x +1 x y Computed Q = 1.125 Exact Q = 1.125 Triangle vertices: (X1,Y1) = (0,3) (X2,Y2) = (1,1) (X3,Y3) = (5,3) Integrand p(x,y) = -40 y +6 x^2 Computed Q = -311.667 Exact Q = -311.667 triangle_poly_integral_test Normal end of execution. triangle_integrals_test(): Normal end of execution. Tue Oct 19 17:25:30 2021