Tue May 20 22:23:37 2025 polygon_monte_carlo_tests(): python version: 3.10.12 numpy version: 1.26.4 Test polygon_monte_carlo(). polygon_area_test(): polygon_area() computes the area of a polygon. Number of polygonal vertices = 4 The polygon vertices: Col: 0 1 Row 0 : 1 0 1 : 2 1 2 : 1 2 3 : 0 1 Exact area is 2 The computed area is 2 Number of polygonal vertices = 8 The polygon vertices: Col: 0 1 Row 0 : 0 0 1 : 3 0 2 : 3 3 3 : 2 3 4 : 2 1 5 : 1 1 6 : 1 2 7 : 0 2 Exact area is 6 The computed area is 6 polygon_monomial_integral_test(): polygon_monomial_integral() evaluates the integral of a monomial x^p y^q over the interior of a polygon in 2D. Polygon vertices: Col: 0 1 Row 0 : 0 0 1 : 1 0 2 : 0 1 P Q Integral 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 polygon_monte_carlo_test(): polygon_sample() estimates integrals over the interior of a polygon in 2D. N 1 X^2 Y^2 X^4 X^2Y^2 Y^4 X^6 1 4 3.44627 0.733261 2.96919 0.631753 0.134418 2.55815 2 4 1.92803 2.10592 1.793 1.6511 1.57711 1.69683 4 4 0.533295 1.25617 0.162319 0.0574023 0.693776 0.0578148 8 4 0.757376 1.4847 0.261917 0.345459 0.825306 0.118925 16 4 1.2511 2.20797 0.826602 0.86879 1.64841 0.636602 32 4 1.09201 0.937238 0.559479 0.2412 0.463564 0.363904 64 4 1.51128 1.51796 0.909922 0.636685 1.0299 0.634983 128 4 1.52089 1.33885 0.958077 0.536446 0.858612 0.696327 256 4 1.32801 1.31393 0.78685 0.400116 0.791055 0.552732 512 4 1.3394 1.26214 0.81803 0.425105 0.743687 0.589995 1024 4 1.25946 1.36262 0.747009 0.431065 0.809894 0.530454 2048 4 1.36577 1.36424 0.824554 0.460815 0.822339 0.58833 4096 4 1.32216 1.31427 0.794508 0.435841 0.779003 0.568904 8192 4 1.33206 1.32973 0.802367 0.440347 0.801549 0.573611 16384 4 1.31681 1.33521 0.790111 0.443484 0.799483 0.56461 32768 4 1.33263 1.34036 0.801762 0.443872 0.802968 0.57368 65536 4 1.33446 1.33524 0.79924 0.446981 0.80166 0.569779 Exact 4 1.33333 1.33333 0.8 0.444444 0.8 0.571429 polygon_sample_test(): polygon_sample() samples a polygon. Sample points: Col: 0 1 Row 0 : 1.82104 0.522831 1 : 1.61785 0.131905 2 : 0.652112 0.425723 3 : 1.38654 0.331994 4 : 0.850585 0.510205 5 : 0.956804 1.00754 6 : 1.34748 0.544832 7 : 0.477846 0.919631 8 : 0.484308 0.191593 9 : 1.87669 0.195659 10 : 1.99878 0.0927686 11 : 1.81376 0.384585 12 : 0.560039 0.856172 13 : 0.492912 0.749735 14 : 0.978347 1.66708 15 : 0.927472 0.586975 16 : 0.431515 0.710474 17 : 0.835149 1.77168 18 : 0.239433 0.181136 19 : 0.664188 0.828129 triangle_area_test(): triangle_area() computes the area of a triangle. (XA,YA) = (0,1) (XB,YB) = (0,0) (XC,YC) = (1,0) Triangle area is 0.5 polygon_monte_carlo_tests(): Normal end of execution. Tue May 20 22:23:38 2025