GIS::D...athTrig(3pm)
π GIS::Distance::MathTrig β the perl one π«Ά
okay so bestie, we're looking at GIS::Distance::MathTrig(3pm) from the User Contributed Perl Documentation collection, and honestly? it's giving β¨ trigonometry but make it cute β¨. it's the manpage for the MathTrig formula class in the GIS::Distance family. let's get into it π
β¨ NAME β¨
GIS::Distance::MathTrig β great circle distance calculations using Math::Trig. π
(no cap, it does exactly what it says on the tin, we love a self-aware module)
πΈ DESCRIPTION πΈ
so this formula uses Math::Trig's great_circle_distance() function, right? and at this time β like, currently, as of this writing β that function uses math that's almost exactly the same formula as the GIS::Distance::Cosine formula. π they're basically twins.
and here's the tea: the Cosine formula is about 5% faster than this formula. π so if you're picking between them... that's a thing you now know. iykyk.
normally, bestie, you do not use this module directly. π instead you use GIS::Distance, which in turn interfaces with the various formula classes for you. it's the main character, this is the supporting cast. π
π§ FORMULA π§
here's the math, verbatim, no notes:
lat0 = 90 degrees - phi0
lat1 = 90 degrees - phi1
d = R * arccos(cos(lat0) * cos(lat1) * cos(lon1 - lon01) + sin(lat0) * sin(lat1))
as stated in the Math::Trig documentation. π slay.
π«Ά SUPPORT π«Ά
see "SUPPORT" in GIS::Distance. that's where the help lives, go look there π
π AUTHORS π
see "AUTHORS" in GIS::Distance. the legends are credited over there β¨
π LICENSE π
see "LICENSE" in GIS::Distance. legal stuff, very demure, very mindful πΈ
and that's the whole page, bestie!! it shipped with perl v5.36.0 and the date on it is 2023-10-21 β so it's got a lil vintage moment going on. anyway, go calculate some great circle distances, you absolute icon π πβ¨
π¦ where this page comes from
- debian trixie: libgis-distance-perl 0.20-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgis-distance-perl 0.20-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgis-distance-perl 0.20-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgis-distance-perl 0.20-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms