Incomplete work for XS-based convex_hull

This commit is contained in:
Alessandro Ranellucci 2013-11-22 21:43:35 +01:00
parent a950fbe0c2
commit 4577f0725c
9 changed files with 38 additions and 28 deletions

View file

@ -9,7 +9,7 @@ our @EXPORT_OK = qw(
line_point_belongs_to_segment points_coincide distance_between_points
chained_path_items chained_path_points normalize tan move_points_3D
point_in_polygon point_in_segment segment_in_segment
point_is_on_left_of_segment polyline_lines polygon_lines
polyline_lines polygon_lines
point_along_segment polygon_segment_having_point polygon_has_subsegment
deg2rad rad2deg
rotate_points move_points
@ -20,6 +20,7 @@ our @EXPORT_OK = qw(
rad2deg_dir bounding_box_center line_intersects_any douglas_peucker
polyline_remove_short_segments normal triangle_normal polygon_is_convex
scaled_epsilon bounding_box_3D size_3D size_2D
convex_hull
);
@ -174,13 +175,6 @@ sub segment_in_segment {
return point_in_segment($needle->[A], $haystack) && point_in_segment($needle->[B], $haystack);
}
sub point_is_on_left_of_segment {
my ($point, $line) = @_;
return (($line->[B][X] - $line->[A][X])*($point->[Y] - $line->[A][Y])
- ($line->[B][Y] - $line->[A][Y])*($point->[X] - $line->[A][X])) > 0;
}
sub polyline_lines {
my ($polyline) = @_;
my @points = @$polyline;