problem0(): mean and std of random triangle area. mean area is 0.44346288406706585 std of area is 0.40013380234910445 problem1(): likelihood that random triangle is obtuse.. number of tests 100 obtuse triangles 76 estimated probability = 0.76 problem2(): draw the polygon graph. Graphics saved as "polygon_graph.png" problem3(): triangulate polygon graph, compute areas, sum. Triangle areas: [2. 2. 2.5 2. ] Polygon area 8.500000000000002 problem4(): triangulate polygon graph, compute centroids, compute centroid of polygon by weighted sum. Triangle centroids: [[2.66666667 1.66666667] [2. 3.33333333] [1. 2.33333333] [1.33333333 1. ]] Polygon centroid [1.70588235 2.09803922] problem5(): Estimate area of example triangle by random sampling. Estimated area of triangle is 19.6736 Actual area is 20. problem6(): estimate integral of f(x,y) over example triangle using Monte Carlo method. Integral estimate is 6161.939780350342 problem7(): estimate integral of f(x,y) over example triangle using six-point rule. Integral estimate is 6053.333333333338 problem8(): Compute distance from point to triangle. Triangle distance for [2 5] is 9.930136612989092e-16 Triangle distance for [10 3] is 2.0 Triangle distance for [4 5] is 0.8000000000000007 problem9(): find intersection of two lines. Computed intersection is [4. 1.] Expected intersection is (4,1).