Tue May 20 22:43:12 2025 triangle01_monte_carlo_tests(): python version: 3.10.12 numpy version: 1.26.4 Test triangle01_monte_carlo(). triangle01_area_test triangle01_area computes the area of the unit triangle. Triangle vertices (columns) Col: 0 1 2 Row 0 : 0 0 1 1 : 1 0 0 Triangle area is 0.5 triangle01_monomial_integral_test 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_monte_carlo_test01 triangle01_monte_carlo estimates an integral over the unit triangle using the Monte Carlo method. N 1 X Y X^2 XY Y^2 X^3 1 0.5 0.354456 0.180045 0.0497048 0.070767 0.20821 0.0474843 2 0.5 0.236778 0.0899382 0.041617 0.0119872 0.0423828 0.0569411 4 0.5 0.225766 0.143244 0.0169046 0.0159253 0.0841884 0.0351974 8 0.5 0.161787 0.162915 0.151434 0.0371828 0.053874 0.0348792 16 0.5 0.0982461 0.181854 0.0396591 0.0476938 0.131488 0.0354101 32 0.5 0.150459 0.134654 0.0666255 0.0546064 0.0985689 0.0417784 64 0.5 0.18985 0.147308 0.0788693 0.0434521 0.0851756 0.0521087 128 0.5 0.149628 0.193216 0.0708919 0.0396346 0.0792255 0.0431078 256 0.5 0.156349 0.169001 0.0733354 0.0422154 0.086699 0.0490445 512 0.5 0.158249 0.169748 0.0948164 0.0407187 0.0857427 0.0549306 1024 0.5 0.16217 0.169308 0.0898402 0.0431743 0.0806464 0.0498567 2048 0.5 0.1709 0.166074 0.083588 0.0417887 0.0817899 0.0520216 4096 0.5 0.16669 0.165029 0.0800304 0.0421323 0.0847285 0.0477917 8192 0.5 0.16717 0.164732 0.0826892 0.041485 0.0823794 0.0507174 16384 0.5 0.166089 0.166451 0.0827391 0.0418533 0.083092 0.0502043 32768 0.5 0.165961 0.167577 0.0834511 0.0414561 0.0836302 0.0503175 65536 0.5 0.166867 0.1664 0.0834018 0.0417586 0.0830381 0.0500018 Exact 0.5 0.166667 0.166667 0.0833333 0.0416667 0.0833333 0.05 triangle01_sample_test(): triangle01_sample() samples the unit triangle. Triangle vertices: Row: 0 1 Col 0 : 0 1 1 : 0 0 2 : 1 0 Sample points (X,Y): Sample points: Row: 0 1 Col 0 : 0.505723 0.345618 1 : 0.466663 0.269146 2 : 0.571275 0.186866 3 : 0.25045 0.3747 4 : 0.257292 0.236503 5 : 0.743879 0.0683139 6 : 0.214865 0.44982 7 : 0.147059 0.392672 8 : 0.0947997 0.890217 9 : 0.46933 0.514179 triangle01_monte_carlo_tests(): Normal end of execution. Tue May 20 22:43:19 2025