lib/SVG/Estimate/Role/Pythagorean.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 16 / 16 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
pythagorean
1.0
CRAP 1.0
« lib/SVG/Estimate/Polygon.pm ↑ Summary
1 package SVG::Estimate::Role::Pythagorean;
2 32 $SVG::Estimate::Role::Pythagorean::VERSION = '1.0116';
3 32 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 32 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 SVG::Estimate::Role::Pythagorean - Use Pythagorean theorem to calc distance
9  
10 =head1 VERSION
11  
12 version 1.0116
13  
14 =head1 METHODS
15  
16 =head2 pythagorean ( point1, point2 )
17  
18 Calculates the distance between two points.
19  
20 =cut
21  
22 sub pythagorean {
23 4957 ▶ my ($self, $p1, $p2) = @_;
Subroutine pythagorean: called CC=1 SCAR=0.0
Pod documented
24 4957 my $dy = $p2->[1] - $p1->[1];
25 4957 my $dx = $p2->[0] - $p1->[0];
26 4957 return sqrt(($dx**2)+($dy**2));
27 }
28  
29  
30 32 1;
« lib/SVG/Estimate/Polygon.pm ↑ Summary