Math::Shape::Line - a 2d vector-based infinite line
version 0.12
Constructor, requires 4 values: the x,y values for the base and direction vectors.
my $line = Math::Shape::Line->new(1, 2, 3, 4);
Boolean method returns 1 if the line is equivalent to another line object. Lines are equivalent when they are parallel and the base vector of one line occurs along the other line. Requires a Math::Shape::Line object as an argument.
if ($line->is_equivalent($other_line) { ... }
Boolean method that returns 1 if both points of a LineSegment object are on the same side of the line. Requires a Math::Shape::LineSegment object as an argument.
Boolean method that returns 1 if the line collides with another Math::Shape::Vector library object or not or 0 if not. Requires a Math::Shape::Vectorlibrary object as an argument
my $l1 = Math::Shape::Line(4, 2); my $l2 = Math::Shape::Line(4, 2); $l1->collides($l2); # 1
David Farrell <sillymoos@cpan.org>
This software is copyright (c) 2014 by David Farrell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Math::Shape::Vector, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Shape::Vector
CPAN shell
perl -MCPAN -e shell install Math::Shape::Vector
For more information on module installation, please visit the detailed CPAN module installation guide.