The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Math::Shape::Line - a 2d vector line object - an infinite 2d line

VERSION

version 0.06

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. Requires a Math::Shape::Line object as an argument.

one_one_side

Boolean method that returns 1 if both points of a line segment 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 line or 0 if not. Requires a Math::Shape::Line 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 <sillymoos@cpan.org>

COPYRIGHT AND LICENSE

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.