use strict;
use warnings;
use Math::Geometry::Planar;
my $polygon = Math::Geometry::Planar->new;
my $points = [[0,0],
[1,0],
[1,1],
[0,1],
];
$polygon->points($points) ;
print "Perimeter:",$polygon->perimeter,"\n" ;
print "Area: ",$polygon->area,"\n" ;
for my $point ( [.725,.396], [2,3], [1,1] ) {
if ($polygon->isinside($point)) {
print "point @{$point} is inside\n" ;
}else{
print "point @{$point} is outside\n" ;
}
}