triangle_test(): Centroid = [4. 4.33333333] Side lengths: [10. 8.94427191 4.47213595] Angles in radians and degrees: 1.11 63.43 0.46 26.57 1.57 90.00 Area = 20.0 Signed area = 20.0 Signed area = 20.0 Triangle orientation *(+1) means counterclockwise Example triangle orientation is 1 Reversed example triangle orientation is -1 Triangle contains point? [1.0, 2.0] False [2.0, 5.0] True [4.0, 4.0] True Triangle barycentric coordinates: xy = [4, 1] barycentric = [1. 0. 0.] xy = [2, 5] barycentric = [0.5 0. 0.5] xy = [4, 4.3333] barycentric = [0.33334 0.33333 0.33333] xy = [5, 0] barycentric = [ 1.05 0.1 -0.15] Triangle samples [7.93923223 2.99064096] [5.4122709 4.78307843] [2.3342767 7.24772253] [4.32148839 4.27400076] [6.05614836 3.80586907] [4.53544796 4.19266689] [6.15770806 3.60140834] [6.81776495 2.72701775] [4.60136687 4.75963991] [0.70966149 7.60622552] Graphics saved as "triangle_sample.png" Triangle Monte Carlo 10 1032.1902330155835 100 811.587449626185 1000 810.4555903838585 10000 804.4676114814569 100000 806.3884548845805 Triangle Quad1 695.5555555555554 Triangle Quad6 806.6666666666665