Geo::Geos::LineSegment - Represents a line segment defined by two Coordinates.
use Geo::Geos::Coordinate; use Geo::Geos::LineSegment; use Geo::Geos::Algorithm qw/TYPE_ORIENT_RIGHT TYPE_ORIENT_LEFT TYPE_ORIENT_STRAIGHT/; Geo::Geos::LineSegment->new; # => isa 'Geo::Geos::LineSegment' my $c1 = Geo::Geos::Coordinate->new(1, 1); my $c2 = Geo::Geos::Coordinate->new(5, 1); my $ls = Geo::Geos::LineSegment->new($c1, $c2); # => isa 'Geo::Geos::LineSegment' $ls->getLength; # => 4 $ls->isHorizontal; # => success $ls->isVertical; # => '' my $c3 = Geo::Geos::Coordinate->new(1, 0); my $c4 = Geo::Geos::Coordinate->new(5, 0); $ls->setCoordinates($c3, $c4); $ls->p0; # => Geo::Geos::Coordinate->new(1, 0); $ls->p1; # => Geo::Geos::Coordinate->new(5, 0); $ls->orientationIndex($c2); # => TYPE_ORIENT_STRAIGHT $ls->orientationIndex($ls); # => TYPE_ORIENT_LEFT
GEOS C++ Library
geos::geom::LineSegment
Geo::Geos
Geo::Geos::Algorithm
Geo::Geos::Index::MonotoneChain
Ivan Baidakou <i.baydakov@crazypanda.ru>, Crazy Panda, CP Decision LTD
You may distribute this code under the same terms as Perl itself.
To install Geo::Geos, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Geos
CPAN shell
perl -MCPAN -e shell install Geo::Geos
For more information on module installation, please visit the detailed CPAN module installation guide.