Ported same_line() to XS

This commit is contained in:
Alessandro Ranellucci 2013-11-06 19:38:10 +01:00
parent b5aaeb9b12
commit d8e098ab0e
5 changed files with 21 additions and 9 deletions

View file

@ -14,7 +14,7 @@ our @EXPORT_OK = qw(
polygon_has_vertex polyline_length can_connect_points deg2rad rad2deg
rotate_points move_points clip_segment_polygon
sum_vectors multiply_vector subtract_vectors dot perp polygon_points_visibility
line_intersection bounding_box bounding_box_intersect same_point same_line
line_intersection bounding_box bounding_box_intersect same_point
longest_segment angle3points three_points_aligned line_direction
polyline_remove_parallel_continuous_edges polyline_remove_acute_vertices
polygon_remove_acute_vertices polygon_remove_parallel_continuous_edges
@ -112,11 +112,6 @@ sub same_point {
return $p1->[X] == $p2->[X] && $p1->[Y] == $p2->[Y];
}
sub same_line {
my ($line1, $line2) = @_;
return same_point($line1->[A], $line2->[A]) && same_point($line1->[B], $line2->[B]);
}
sub distance_between_points {
my ($p1, $p2) = @_;
return sqrt((($p1->[X] - $p2->[X])**2) + ($p1->[Y] - $p2->[Y])**2);