Leser: 19
1 2 3 4 5 6 7 8 9 10 11 12
use Data::Dumper; use Math::ConvexHull qw/convex_hull/; print Dumper convex_hull( [ [0,0], [1,0], [0.2,0.9], [0.2,0.5], [0,1], [1,1], ] ); # Prints out the points [0,0], [1,0], [0,1], [1,1].
1 2
use Math::ConvexHull qw/convex_hull/; $hull_array_ref = convex_hull(\@points);
1 2 3
my @points = ([0,0], [1,0], [0.2,0.9], [0.2,0.5],[0,1], [1,1],); $hull_array_ref = convex_hull(\@points); print $hull_array_ref;
1 2 3 4 5
print "@$array_ref\n"; # oder use Data::Dumper; print Dumper $arrayref;