Wed Oct 8 08:46:30 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 1.43403 0.298686 0.514111 0.107081 0.0223033 0.184313 2 4 1.32745 2.73369 0.748704 1.07194 1.95632 0.453009 4 4 0.932989 1.28544 0.541734 0.046211 0.918929 0.362874 8 4 0.867506 2.06281 0.324141 0.257254 1.63643 0.129426 16 4 2.24854 0.827632 1.53649 0.572241 0.489459 1.14503 32 4 1.11794 1.08233 0.566388 0.346816 0.691187 0.371323 64 4 1.55951 1.69789 0.928857 0.669912 1.09027 0.632112 128 4 1.27795 1.5043 0.753899 0.440824 1.00134 0.532669 256 4 1.48542 1.36897 0.93521 0.497543 0.841705 0.685499 512 4 1.31225 1.3232 0.784496 0.433859 0.788242 0.561162 1024 4 1.35816 1.36682 0.821226 0.443164 0.829851 0.587066 2048 4 1.34468 1.33614 0.816258 0.445085 0.792714 0.586191 4096 4 1.31732 1.31437 0.795742 0.431846 0.782664 0.572317 8192 4 1.34801 1.34118 0.812915 0.455819 0.806244 0.580579 16384 4 1.32414 1.33209 0.792434 0.440767 0.79606 0.564144 32768 4 1.33691 1.32835 0.802074 0.443761 0.796871 0.571677 65536 4 1.33211 1.33227 0.798527 0.440995 0.796836 0.570022 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 : 0.0396002 0.574367 1 : 0.266497 0.174618 2 : 1.26365 0.331541 3 : 0.643067 1.40394 4 : 0.245491 0.44533 5 : 0.146642 1.12678 6 : 1.87894 0.456545 7 : 0.951684 1.53528 8 : 0.455012 0.277224 9 : 1.9978 0.590049 10 : 1.88362 0.0714635 11 : 0.274638 1.09888 12 : 0.443202 1.14536 13 : 0.794091 0.0859335 14 : 1.26605 0.940973 15 : 0.500601 0.279066 16 : 0.343784 1.19326 17 : 0.600235 0.0693508 18 : 0.781208 1.15776 19 : 1.54951 0.343901 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. Wed Oct 8 08:46:31 2025