Math::Vector::Real::Polyline - Algorithms related to polylines.
use Math::Vector::Real::Polyline; my $poly1 = Math::Vector::Polyline->new(@vectors1); my $poly2 = Math::Vector::Polyline->new(@vectors2); my $d = $poly1->dist_to_polyline(@poly2); printf "The distance between %s and %s is %f", $poly1, $poly2, $d;
This module implements several algorithms related to polygonal chains or polylines.
Note that the module can handle polylines in spaces of any dimension (not just 2D).
Creates a new polyline object.
Returns the square of the distance from the polyline to the given point.
Returns the square of the distance from the polyline to the segment with the given vertices.
Returns the square of the distance between both polylines.
Math::Vector::Real.
Polygonal Chain at Wikipedia.
The StarOverflow post that started it.
Copyright (C) 2017 by Salvador Fandiño <sfandino@yahoo.com>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.1 or, at your option, any later version of Perl 5 you may have available.
To install Math::Vector::Real::Polyline, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Vector::Real::Polyline
CPAN shell
perl -MCPAN -e shell install Math::Vector::Real::Polyline
For more information on module installation, please visit the detailed CPAN module installation guide.