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 The new() constructor
25
26 my $obj = Geo::Functions->new();
27
29 deg_dms
30 Degrees given degrees minutes seconds.
31
32 my $deg=deg_dms(39, 29, 17.134);
33
34 my $deg=deg_dms(39, 29, 17.134, 'N');
35
36 deg_rad
37 Degrees given radians.
38
39 my $deg=deg_rad(3.14);
40
41 rad_deg
42 Radians given degrees.
43
44 my $rad=rad_deg(90);
45
46 rad_dms
47 Radians given degrees minutes seconds.
48
49 my $rad=rad_dms(45 30 20.0);
50
51 round
52 Round to the nearest integer. This formula rounds toward +/- infinity.
53
54 my $int=round(42.2);
55
56 dms_deg
57 Degrees minutes seconds given degrees.
58
59 my ($d, $m, $s, $sign)=dms_deg($degrees, qw{N S});
60 my ($d, $m, $s, $sign)=dms_deg($degrees, qw{E W});
61
62 dm_deg
63 Degrees minutes given degrees.
64
65 my ($d, $m, $sign)=dm_deg($degrees, qw{N S});
66 my ($d, $m, $sign)=dm_deg($degrees, qw{E W});
67
68 mps_knots
69 meters per second given knots
70
71 my $mps=mps_knots(50.0);
72
73 knots_mps
74 knots given meters per second
75
76 my $knots=knots_mps(25.0);
77
80 Please send to the geo-perl email list.
81
84 Michael R. Davis qw/perl michaelrdavis com/
85
87 Copyright (c) 2006 Michael R. Davis (mrdvt92)
88
89 This library is free software; you can redistribute it and/or modify it
90 under the same terms as Perl itself.
91
93 Geo::Constants Geo::Ellipsoids
94
95
96
97perl v5.12.0 2007-10-07 Geo::Functions(3)