line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
PDLA::Constants -- basic compile time constants for PDLA |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 DESCRIPTION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
This module is used to define compile time constant |
8
|
|
|
|
|
|
|
values for PDLA. It uses Perl's L pragma for |
9
|
|
|
|
|
|
|
simplicity and availability. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use PDLA::Constants qw(PI E); |
14
|
|
|
|
|
|
|
print 'PI is ' . PI . "\n"; |
15
|
|
|
|
|
|
|
print 'E is ' . E . "\n"; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
package PDLA::Constants; |
20
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
21
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require Exporter; |
24
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
25
|
|
|
|
|
|
|
@EXPORT_OK = qw(PI DEGRAD E I J); # symbols to export |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
2
|
|
59202
|
use PDLA::Lite; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
16
|
|
28
|
2
|
|
|
2
|
|
965
|
use PDLA::Complex qw(i); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
16
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 PI |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
The ratio of a circle's circumference to its diameter |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
2
|
|
13
|
use constant PI => 4 * atan2(1, 1); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
210
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 DEGRAD |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The number of degrees of arc per radian (180/PI) |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
2
|
|
11
|
use constant DEGRAD => 180/PI; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
92
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 E |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
The base of the natural logarithms or Euler's number |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
2
|
|
|
2
|
|
9
|
use constant E => exp(1); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
80
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 I |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
The imaginary unit, C< I*I == -1 > |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
2
|
|
|
2
|
|
17
|
use constant I => i; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 J |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
The imaginary unit for engineers, C< J*J == -1 > |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
2
|
|
|
2
|
|
10
|
use constant J => i; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
6
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Copyright 2010 Chris Marshall (chm at cpan dot org). |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
75
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
76
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |