1Geo::Functions(3) User Contributed Perl Documentation Geo::Functions(3)
2
3
4
6 Geo::Functions - Package for standard Geo:: functions.
7
9 use Geo::Functions qw{deg_rad deg_dms rad_deg}; #import into namespace
10 print "Degrees: ", deg_rad(3.14/4), "\n";
11
12 use Geo::Functions;
13 my $obj = Geo::Functions->new;
14 print "Degrees: ", $obj->deg_rad(3.14/2), "\n";
15
18 Function naming convention is "format of the return" underscore "format
19 of the parameters." For example, you can read the deg_rad function as
20 "degrees given radians" or "degrees from radians".
21
23 new
24
25 The new() constructor
26
27 my $obj = Geo::Functions->new();
28
30 deg_dms
31
32 Degrees given degrees minutes seconds.
33
34 my $deg=deg_dms(39, 29, 17.134);
35
36 my $deg=deg_dms(39, 29, 17.134, 'N');
37
38 deg_rad
39
40 Degrees given radians.
41
42 my $deg=deg_rad(3.14);
43
44 rad_deg
45
46 Radians given degrees.
47
48 my $rad=rad_deg(90);
49
50 rad_dms
51
52 Radians given degrees minutes seconds.
53
54 my $rad=rad_dms(45 30 20.0);
55
56 round
57
58 Round to the nearest integer. This formula rounds toward +/- infinity.
59
60 my $int=round(42.2);
61
62 dms_deg
63
64 Degrees minutes seconds given degrees.
65
66 my ($d, $m, $s, $sign)=dms_deg($degrees, qw{N S});
67 my ($d, $m, $s, $sign)=dms_deg($degrees, qw{E W});
68
69 dm_deg
70
71 Degrees minutes given degrees.
72
73 my ($d, $m, $sign)=dm_deg($degrees, qw{N S});
74 my ($d, $m, $sign)=dm_deg($degrees, qw{E W});
75
76 mps_knots
77
78 meters per second given knots
79
80 my $mps=mps_knots(50.0);
81
82 knots_mps
83
84 knots given meters per second
85
86 my $knots=knots_mps(25.0);
87
90 Please send to the geo-perl email list.
91
94 Michael R. Davis qw/perl michaelrdavis com/
95
97 Copyright (c) 2006 Michael R. Davis (mrdvt92)
98
99 This library is free software; you can redistribute it and/or modify it
100 under the same terms as Perl itself.
101
103 Geo::Functions Geo::Ellipsoids
104
105
106
107perl v5.8.8 2007-01-15 Geo::Functions(3)