line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Algorithm::Easing::Ease; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use Moose; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
3678
|
use constant EPSILON => 0.000001; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
61
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
423
|
use namespace::clean; |
|
1
|
|
|
|
|
3975
|
|
|
1
|
|
|
|
|
4
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub ease_none { |
10
|
1203
|
|
|
1203
|
1
|
812
|
my $self = shift; |
11
|
1203
|
|
|
|
|
1055
|
my ($t,$b,$c,$d) = (shift,shift,shift,shift); |
12
|
|
|
|
|
|
|
|
13
|
1203
|
50
|
|
|
|
1466
|
return $b if $t < EPSILON; |
14
|
1203
|
50
|
|
|
|
1316
|
return $c if $d < EPSILON; |
15
|
|
|
|
|
|
|
|
16
|
1203
|
|
|
|
|
2372
|
return($c * $t / $d + $b); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub pow { |
20
|
1203
|
|
|
1203
|
0
|
854
|
my $self = shift; |
21
|
1203
|
|
|
|
|
918
|
my ($a, $b) = (shift,shift); |
22
|
|
|
|
|
|
|
|
23
|
1203
|
|
|
|
|
2991
|
return($a ** $b); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# MAN3 POD |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Algorithm::Easing::Ease - This is the base class for an ease. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 METHODS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 ease_none |
43
|
|
|
|
|
|
|
Usage : |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Arguments : |
46
|
|
|
|
|
|
|
Let t be time, |
47
|
|
|
|
|
|
|
Let b be begin, |
48
|
|
|
|
|
|
|
Let c be change, |
49
|
|
|
|
|
|
|
Let d be duration, |
50
|
|
|
|
|
|
|
Return : |
51
|
|
|
|
|
|
|
Let p be position, |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $p = $obj->ease_none($t,$b,$c,$d); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This method is used for a linear translation between two positive real whole integers using a positive real integer as the parameter for time. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHOR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Jason McVeigh, <jmcveigh@outlook.com> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Copyright 2016 by Jason McVeigh |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
70
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |