GIS::D...:Cosine(3pm)

πŸ“¦
version 0.20 Β· 6 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 ⭐


🫢 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