File Coverage

blib/lib/Math/Shape/LineSegment.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   45886 use strict;
  1         2  
  1         34  
2 1     1   5 use warnings;
  1         3  
  1         50  
3             package Math::Shape::LineSegment;
4             $Math::Shape::LineSegment::VERSION = '0.01';
5 1     1   19 use 5.008;
  1         8  
  1         53  
6 1     1   5 use Carp;
  1         2  
  1         102  
7 1     1   1144 use Math::Shape::Vector;
  1         1115  
  1         118  
8              
9             # ABSTRACT: a 2d vector line segment object
10              
11              
12             sub new {
13 1 50   1 1 15 croak 'incorrect number of args' unless @_ == 5;
14 1         4 my ($class, $x1, $y1, $x2, $y2) = @_;
15 1         10 bless { start => Math::Shape::Vector->new($x1, $y1),
16             end => Math::Shape::Vector->new($x2, $y2),
17             }, $class;
18             }
19              
20             1;
21              
22             __END__