File Coverage

blib/lib/Math/Shape/Line.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 26 27 96.3


line stmt bran cond sub pod time code
1 1     1   23270 use strict;
  1         2  
  1         40  
2 1     1   5 use warnings;
  1         2  
  1         55  
3             package Math::Shape::Line;
4             $Math::Shape::Line::VERSION = '0.01';
5 1     1   21 use 5.008;
  1         8  
  1         48  
6 1     1   5 use Carp;
  1         1  
  1         90  
7 1     1   869 use Math::Shape::Vector;
  1         981  
  1         108  
8              
9             # ABSTRACT: a 2d vector line object
10              
11              
12             sub new {
13 1 50   1 1 18 croak 'incorrect number of args' unless @_ == 5;
14 1         3 my ($class, $x1, $y1, $x2, $y2) = @_;
15 1         9 bless { base => Math::Shape::Vector->new($x1, $y1),
16             direction => Math::Shape::Vector->new($x2, $y2),
17             }, $class;
18             }
19              
20             1;
21              
22             __END__