line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::VectorXYZ::2D; |
2
|
2
|
|
|
2
|
|
1404
|
use base Math::VectorXYZ; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
446
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
26
|
use 5.006; |
|
2
|
|
|
|
|
5
|
|
7
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
34
|
|
8
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
46
|
|
9
|
2
|
|
|
2
|
|
16
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
98
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
9
|
use Exporter 'import'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
309
|
|
12
|
|
|
|
|
|
|
our @EXPORT = ('Vec'); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#----------------------------------------- object constructors --------------------------------------- |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
# Instructions: Provide a list of two numbers (x,y) to the constructor |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------------------- |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
0
|
4
|
my $class = shift; |
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
3
|
if ( @_ != 2 ) { |
25
|
0
|
|
|
|
|
0
|
croak '*** Error; syntax is "$vec = VectorXYZ->new(x,y)" ***'; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
3
|
return bless [ @_, 0 ], $class; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub Vec { |
32
|
|
|
|
|
|
|
|
33
|
12
|
50
|
|
12
|
0
|
735
|
if ( @_ != 2 ) { |
34
|
0
|
|
|
|
|
0
|
croak '*** Error; syntax is "$vec = Vec(x,y)" ***'; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
12
|
|
|
|
|
42
|
return bless [ @_, 0 ], __PACKAGE__; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
#----------------------------------------- object methods --------------------------------------- |
41
|
|
|
|
|
|
|
# |
42
|
|
|
|
|
|
|
# Inherited from parent class except as given below: |
43
|
|
|
|
|
|
|
# |
44
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------------------- |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub as_string { |
47
|
1
|
|
|
1
|
0
|
444
|
my $self = shift; |
48
|
1
|
|
|
|
|
8
|
return "<" . join(",", @$self[0,1]) . ">"; # |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |