Geo::Functions(3pm)
π Geo::Functions π
okay so bestie, welcome to Geo::Functions β it's a package for standard Geo:: functions, and it's genuinely giving useful little toolkit energy. No cap. This is the Geo::Functions page from the User Contributed Perl Documentation, and we're gonna go through the whole thing together. Grab a strawberry π, we're doing this.
β¨ SYNOPSIS β¨
Two ways to vibe with this, bestie β either you import the functions straight into your namespace, or you go full object-oriented main character:
use Geo::Functions qw{deg_rad deg_dms rad_deg}; #import into namespace
print "Degrees: ", deg_rad(3.14/4), "\n";
use Geo::Functions;
my $obj = Geo::Functions->new;
print "Degrees: ", $obj->deg_rad(3.14/2), "\n";
like, look at her. importing exactly the three she needs. we love a girl who knows what she wants π
πΈ DESCRIPTION πΈ
Package for standard Geo:: functions.
that's it. that's the whole description. short, sweet, iconic, ate and left no crumbs π
π¦ CONVENTIONS π¦
okay this part is SO important and honestly lowkey genius, listen up:
The naming convention is "format of the return" underscore "format of the parameters".
So like, you can read the deg_rad function as "degrees given radians" or "degrees from radians". Return first, input second. Once you clock that pattern, every single function name in here just... makes sense immediately. it's giving cheat code. iykyk β¨
π CONSTRUCTOR π
new
The new() constructor, bestie. here she is:
my $obj = Geo::Functions->new();
that's your object. your little guy. your baby. go forth π«Ά
π METHODS π
initialize
no description in the source for this one, bestie β she's just... there. mysterious. main character energy without a backstory π
deg_dms
Degrees given degrees minutes seconds. yes, that's a lot of degrees, we know, we're all a little dizzy π
my $deg = deg_dms(39, 29, 17.134);
my $deg = deg_dms(39, 29, 17.134, 'N');
you can hand her a hemisphere letter at the end if you're feeling fancy π
deg_rad
Degrees given radians. the classic. the moment. the icon:
my $deg = deg_rad(3.14);
rad_deg
Radians given degrees. it's the reverse, it's the mirror, it's the twin flame situation π
my $rad = rad_deg(90);
rad_dms
Radians given degrees minutes seconds:
my $rad = rad_dms(45 30 20.0);
(and yeah bestie, that's exactly how it's written up there β commas? not today. we're keeping it exactly as the page says π)
round
Round to the nearest integer. and this is important, so listen: this formula rounds toward +/- infinity. don't come at me, that's just what she does π
my $int = round(42.2);
dms_deg
Degrees minutes seconds given degrees. she hands you back a whole little list β $d, $m, $s, and a $sign:
my ($d, $m, $s, $sign) = dms_deg($degrees, qw{N S});
my ($d, $m, $s, $sign) = dms_deg($degrees, qw{E W});
north/south girlies and east/west girlies, she's got you both πΈ
dm_deg
Degrees minutes given degrees. slightly shorter list than her sister above, no seconds here, just vibes:
my ($d, $m, $sign) = dm_deg($degrees, qw{N S});
my ($d, $m, $sign) = dm_deg($degrees, qw{E W});
mps_knots
meters per second given knots:
my $mps = mps_knots(50.0);
knots_mps
knots given meters per second β and yes, it's the other direction, it's the remix:
my $knots = knots_mps(25.0);
π BUGS π
Please log on GitHub.
that's the whole thing. go log it on GitHub bestie, don't suffer in silence π
π AUTHOR π
Michael R. Davis
π LICENSE π
MIT License
Copyright (c) 2022 Michael R. Davis
MIT! permissive! do your thing! slay! π₯
π SEE ALSO π
Geo::ConstantsGeo::Ellipsoids
go read those next, bestie, they're in the same universe β
and that's the whole page!! written by perl v5.36.0 and dated 2022-11-21, from the User Contributed Perl Documentation β so go make some coordinates, round some integers toward infinity, convert whatever you need to convert, and remember: degrees given radians. return first, parameters second. periodt π β¨π§π
π¦ where this page comes from
- debian bookworm: libgeo-functions-perl 0.08-1 Β· MIT
- debian trixie: libgeo-functions-perl 0.08-1 Β· MIT
- ubuntu noble: libgeo-functions-perl 0.08-1 Β· MIT
- ubuntu resolute: libgeo-functions-perl 0.08-1 Β· MIT
- ubuntu stonking: libgeo-functions-perl 0.08-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms