Sat Dec 17 17:20:10 2022 polygon_test(): Python version: 3.6.9 Test polygon(). polygon_angles_test(): polygon_angles() computes the angles of a polygon. Number of polygonal vertices = 6 polygon vertices: [[0. 1. 2. 3. 3. 1.] [0. 0. 1. 0. 2. 1.]] Polygonal angles in degrees: 0 45 1 135 2 270 3 45 4 63.4349 5 161.565 polygon_area_test(): polygon_area() computes the area of a polygon. polygon_area_2() computes the area of a polygon. polygon_area_3() computes the area of a polygon. Number of polygonal vertices = 4 polygon vertices: [[1. 2. 1. 0.] [0. 1. 2. 1.]] Exact area is 2.0 polygon_area(): 2.0 polygon_area_2(): 2.0 polygon_area_3(): 2.0 Number of polygonal vertices = 8 polygon vertices: [[0. 3. 3. 2. 2. 1. 1. 0.] [0. 0. 3. 3. 1. 1. 2. 2.]] Exact area is 6.0 polygon_area(): 6.0 polygon_area_2(): 6.0 polygon_area_3(): 6.0 polygon_centroid_test(): polygon_centroid() computes the centroid of a polygon. polygon_centroid_2() computes the centroid of a polygon. polygon vertices: [[1. 2. 1. 0.] [0. 1. 2. 1.]] polygon_centroid(): [1. 1.] polygon_centroid_2(): [1. 1.] polygon_contains_point_test(): polygon_contains_point() determines if a point is in a polygon. polygon vertices: [[0. 1. 2. 1. 0.] [0. 0. 1. 2. 2.]] P Inside 1 1 1 3 4 0 0 2 1 0.5 -0.25 0 polygon_data_test(): polygon_data_inrad() describes a regular polygon using the inradius. polygon_data_outrad() describes a regular polygon using the outradius. polygon_data_side() describes a regular polygon using the side. Number of polygonal sides = 3 AREA = 0.43301270189221946 RADIN = 0.288675134594813 RADOUT = 0.5773502691896258 SIDE = 1.0 (given) AREA = 0.43301270189221946 RADIN = 0.288675134594813 (given) RADOUT = 0.5773502691896258 SIDE = 1.0 AREA = 0.43301270189221946 RADIN = 0.288675134594813 RADOUT = 0.5773502691896258 (given) SIDE = 1.0 Number of polygonal sides = 4 AREA = 1.0000000000000002 RADIN = 0.5000000000000001 RADOUT = 0.7071067811865476 SIDE = 1.0 (given) AREA = 1.0000000000000002 RADIN = 0.5000000000000001 (given) RADOUT = 0.7071067811865476 SIDE = 1.0 AREA = 1.0000000000000002 RADIN = 0.5000000000000001 RADOUT = 0.7071067811865476 (given) SIDE = 1.0 Number of polygonal sides = 5 AREA = 1.720477400588967 RADIN = 0.6881909602355868 RADOUT = 0.8506508083520399 SIDE = 1.0 (given) AREA = 1.720477400588967 RADIN = 0.6881909602355868 (given) RADOUT = 0.8506508083520399 SIDE = 1.0 AREA = 1.7204774005889665 RADIN = 0.6881909602355868 RADOUT = 0.8506508083520399 (given) SIDE = 1.0 polygon_diameter_test(): polygon_diameter() computes the diameter of a polygon. polygon vertices: [[1. 2. 1. 0.] [0. 1. 2. 1.]] Diameter ( computed ) 2 Diameter ( exact ) 2 polygon_expand_test(): polygon_expand() "expands" a polygon by an amount H. polygon vertices: [[1. 5. 2. 1.] [1. 1. 4. 3.]] The expansion amount H = 0.5 expanded polygon vertices: [[0.5 6.20710678 2. 0.5 ] [0.5 0.5 4.70710678 3.20710678]] polygon_integral_test(): polygon_integral_1() integrates 1 over a polygon polygon_integral_x() integrates x over a polygon polygon_integral_y() integrates y over a polygon polygon_integral_xx() integrates xx over a polygon polygon_integral_xy() integrates xy over a polygon polygon_integral_yy() integrates yy over a polygon polygon vertices: [[1. 4. 2.] [1. 3. 5.]] 1: 5.0 x: 11.666666666666666 y: 15.0 xx: 29.166666666666668 xy: 35.833333333333336 yy: 48.333333333333336 polygon_is_ccw_test(): polygon_is_cc2() determines if the vertices of a polygon are listed in counter-clockwise order. polygon vertices: [[0. 0.] [1. 0.] [1. 1.] [0. 1.]] The polygon vertices are counter clockwise. polygon vertices: [[0. 0.] [1. 0.] [0. 1.] [1. 1.]] The polygon vertices are NOT counter clockwise. polygon vertices: [[0. 0.] [1. 1.] [1. 0.] [0. 1.]] The polygon vertices are NOT counter clockwise. polygon vertices: [[0. 0.] [1. 1.] [0. 1.] [1. 0.]] The polygon vertices are NOT counter clockwise. polygon vertices: [[0. 0.] [0. 1.] [1. 0.] [1. 1.]] The polygon vertices are NOT counter clockwise. polygon vertices: [[0. 0.] [0. 1.] [1. 1.] [1. 0.]] The polygon vertices are NOT counter clockwise. polygon_is_convex_test(): polygon_is_convex() determines if a polygon is convex. polygon vertices: [[0.] [0.]] The polygon is degenerate and convex. polygon vertices: [[0. 1.] [0. 2.]] The polygon is degenerate and convex. polygon vertices: [[0. 2. 1.] [0. 0. 0.]] The polygon is convex and clockwise. polygon vertices: [[0. 1. 0.] [0. 0. 2.]] The polygon is convex and counterclockwise. polygon vertices: [[0. 0. 1.] [0. 2. 0.]] The polygon is convex and clockwise. polygon vertices: [[1. 2. 3. 0.] [0. 0. 1. 1.]] The polygon is convex and counterclockwise. polygon vertices: [[0. 0.5 1. 1. 0. ] [0. 0.5 0. 1. 1. ]] The polygon is not convex. polygon vertices: [[ 1. -0.80901699 0.30901699 0.30901699 -0.80901699] [ 0. 0.58778525 -0.95105652 0.95105652 -0.58778525]] The polygon is not convex. polygon vertices: [[ 1.00000000e+00 5.00000000e-01 -5.00000000e-01 -1.00000000e+00 -5.00000000e-01 5.00000000e-01] [ 0.00000000e+00 8.66025404e-01 8.66025404e-01 1.22464680e-16 -8.66025404e-01 -8.66025404e-01]] The polygon is convex and counterclockwise. polygon vertices: [[0. 2. 1. 0. 2. 1.] [0. 0. 1. 0. 0. 1.]] The polygon is not convex. polygon vertices: [[1. 3. 3. 0. 0. 2. 2. 1.] [0. 0. 3. 3. 1. 1. 2. 1.]] The polygon is not convex. polygon_area_lattice_test(): polygon_area_lattice() returns the "area" of a polygon, measured in lattice points. Number of interior lattice points = 5 Number of boundary lattice points = 6 Area of polygon is 7 polygon_perimeter_test(): polygon_perimeter() computes the perimeter of a polygon. polygon vertices: [[0. 1. 1. 0.] [0. 0. 1. 1.]] Perimeter of V1 = 4 polygon vertices: [[1. 4. 2.] [1. 3. 5.]] Perimeter of V2 = 10.5571 polygon_perimeter_quad_test(): polygon_perimeter_quad() estimates the integral of a function over the perimeter of a polygon using the composite midpoint rule over each side. polygon vertices: [[0. 1. 1. 0.] [0. 0. 1. 1.]] Using HMAX = 0.5, estimated integral of 1 over perimeter = 4 Using HMAX = 1, estimated integral of x^2 over perimeter = 1.5 Using HMAX = 0.5, estimated integral of x^2 over perimeter = 1.625 Using HMAX = 0.25, estimated integral of x^2 over perimeter = 1.65625 polygon vertices: [[1. 4. 2.] [1. 3. 5.]] Using HMAX = 0.5, estimated integral of 1 over perimeter = 10.5571 Using HMAX = 1, estimated integral of x^2 over perimeter = 60.9706 Using HMAX = 0.5, estimated integral of x^2 over perimeter = 61.1854 Using HMAX = 0.25, estimated integral of x^2 over perimeter = 61.2383 polygon_point_dist_test(): polygon_point_dist() computes polygon-point distance. polygon vertices: [[1. 4. 2.] [1. 3. 5.]] X Y DIST 4 5 1.41421 2 3 0.485071 -2 -1 3.60555 polygon_point_near_test(): polygon_point_near() computes nearest point on polygon. polygon vertices: [[1. 4. 2.] [1. 3. 5.]] X Y XN YN 4 5 3 4 2 3 1.52941 3.11765 -2 -1 1 1 polygon_sample_test(): polygon_sample() samples a polygon. sample points: [[1.37682697 0.88518104 1.15427556 1.27944945 1.60350741 1.67953548 0.14635176 1.09416307 0.70690452 1.04311936 1.52863949 1.10338923 0.84689673 0.47626952 0.6267366 0.60233864 0.47566512 0.9121087 1.36152436 0.84798779] [0.52213727 0.27306187 0.59440203 0.71714948 0.09234516 0.12583955 0.88377692 0.68680969 1.35315285 0.53132254 0.43457879 0.14596319 0.71667165 0.73338378 0.21563957 1.45329185 0.64632151 0.91026244 0.01653743 1.52609451]] polygon_triangulate_test(): polygon_triangulate() triangulates a polygon. Triangles of the trinangulation: [[2 0 1] [4 2 3] [6 4 5] [8 6 7] [9 6 8] [2 9 0] [4 9 2] [6 9 4]] polygon_test(): Normal end of execution. Sat Dec 17 17:20:10 2022