NAME
Math::Shape::Line - a 2d vector-based infinite line
VERSION
version 0.15
METHODS
new
Constructor, requires 4 values: the x,y values for the base and direction vectors.
my $line = Math::Shape::Line->new(1, 2, 3, 4);
is_equivalent
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)
{
...
}
one_one_side
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.
collides
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
AUTHOR
David Farrell <dfarrell@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 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.