Further simplification of point_in_polygon()
This commit is contained in:
parent
4f5870fdb6
commit
7d6545dd07
@ -155,12 +155,8 @@ sub point_in_polygon {
|
|||||||
|
|
||||||
my ($x, $y) = @$point;
|
my ($x, $y) = @$point;
|
||||||
my $n = @$polygon;
|
my $n = @$polygon;
|
||||||
my @x;
|
my @x = map $_->[X], @$polygon;
|
||||||
my @y;
|
my @y = map $_->[Y], @$polygon;
|
||||||
foreach (0..$n-1) {
|
|
||||||
push @x, $polygon->[$_]->[X];
|
|
||||||
push @y, $polygon->[$_]->[Y];
|
|
||||||
}
|
|
||||||
|
|
||||||
# Derived from the comp.graphics.algorithms FAQ,
|
# Derived from the comp.graphics.algorithms FAQ,
|
||||||
# courtesy of Wm. Randolph Franklin
|
# courtesy of Wm. Randolph Franklin
|
||||||
|
Loading…
Reference in New Issue
Block a user