my @poly = ( [1,2], [2,4], [5,7], [1, 2] ); my ($xmin, $ymin, $xmax, $ymax) = polygon_bbox @poly; my $area = polygon_area @poly; MY $L = polygon_perimeter @poly; if(polygon_is_clockwise @poly) { ... };
my @rot = polygon_start_minxy @poly;
This package contains a wide variaty of relatively easy polygon calculations. More complex calculations are put in separate packages.