GIS::D...:Cosine(3pm)
π NAME π
okay so bestie, meet GIS::Distance::Cosine β¨ β it lives in the User Contributed Perl Documentation corner of the perl-verse (you'll see it hanging out as GIS::D...:Cosine(3pm) when the terminal truncates it, rip to long names π). Its whole job? Spherical law of cosines distance calculations. That's it, that's the gig π
πΈ DESCRIPTION πΈ
so here's the tea, and it's a little bittersweet π:
Although this formula is mathematically exact, it is unreliable for small distances.
likeβ¦ she's correct on paper, she's giving mathematically exact, but for tiny distances? nope, she's not it. π See GIS::Distance::MathTrig for related details if you want the full lore.
now, if you want the fast version of this exact same formula, there's a faster (XS) one available as GIS::Distance::Fast::Cosine π₯ XS = compiled C energy, no cap.
and the biggest vibe check of all: normally this module is not used directly. π Instead, GIS::Distance is used, which in turn interfaces with the various formula classes. So like, this module is the main character's best friend, not the main character β it does its thing behind the scenes π
π FORMULA π
here's the math, and yes she's pretty π¦:
a = sin(lat1) * sin(lat2)
b = cos(lat1) * cos(lat2) * cos(lon2 - lon1)
c = arccos(a + b)
d = R * c
that's the whole recipe, periodt. π
β SEE ALSO β
- <https://en.wikipedia.org/wiki/Spherical_law_of_cosines> β go read up bestie, iykyk π
π«Ά SUPPORT π«Ά
See "SUPPORT" in GIS::Distance.
π AUTHORS π
See "AUTHORS" in GIS::Distance.
π LICENSE π
See "LICENSE" in GIS::Distance.
perl v5.36.0 πΈ 2023-10-21 πΈ GIS::D...:Cosine(3pm) β mwah, that's the page, thanks for coming to my ted talk, love u, bye bestie πβ¨π
π¦ 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