News for hackers. Stuff that matters.

mourner

The commenter probably meant https://github.com/iShape-Rust/iTriangle, a sibling library that is indeed quite fast at triangulation, especially on bigger inputs
Very high constants and high implementation complexity — I attempted it and gave up before coming up with earcut (Seidel was both slower and less robust on typical map data). Maybe worth another attempt — working on algorithmic libraries is much easier now thanks to LLM-driven validation/optimization loops.
For practical data, a faster approach is usually to triangulate without validation, then just measure if triangulation is valid afterwards (which is simply comparing the sum of triangle areas with polygon area)
Having triangulation conform to Delaunay is a big advantage though! You should also try out https://github.com/mapbox/earcut.hpp for the benchmark — it got a refine function recently that refines earcut output to Delaunay as well, and earcut+refine is still pretty fast.
Hey Evgen, Earcut author here — thanks for the writeup and a really cool library! I need to see if there are any tricks to borrow for Earcut's JS version. :)

One thing to note is that I deliberately had to reject some of the potential optimizations to keep the library small, so that bundle size doesn't blow up — for most practical applications (e.g. Mapbox GL JS), it's already fast enough (and 4.1k min/gz). Curious how big the WASM build of Earstrip is.

On the C++ side, Mapbox now uses a hybrid approach where small polygons are processed with earcut.hpp, while big and complex polygon switch to a different algorithm based on monotone decomposition, because while it has higher constants in algorithmic complexity, it scales much better with input size.

Re:Sun Clock on Monday August 17, 2026 @04:44PM (#49337369)
Initially (about 15 years ago - it was my first ever open source library!) it was based on Astronomy Answers articles that are thankfully still live at https://www.aa.quae.nl/en/reken/zonpositie.html, but v2.0 specifically was rewritten to use the approach described in Jean Meeus' Astronomical Algorithms book.
Re:Sun Clock on Monday August 17, 2026 @04:03PM (#49336758)
Author of suncalc here — happy to see such a nice application of it! Heads up if the author's reading this — I recently released a major overhaul of the library that makes it a lot more precise: https://github.com/mourner/suncalc
Re:Better Gaussian Splatting in Julia on Thursday August 13, 2026 @10:14AM (#49286308)
Oh, a fellow Ukrainian! Was pleasantly surprised to see that fountain on HN — I was just walking around it a few days ago, very nice and peaceful spot this time of year.

Show HN: SunCalc v2 – a tiny JavaScript library for sun and moon calculations

https://github.com/mourner/suncalc

SunCalc is one of my first open source projects — made the first commit 15 years ago and it had its share of wonderful uses ever since, but it's been somewhat neglected in recent years. Now that modern AI tools give me the ability to catch up on years of accumulated tech debt and user issues, I finally have the capacity to revive projects like this and keep them in excellent shape.v2 is a new...

( Read More... | no comments | on HN )
Re:Map Clustering Is Not My Favorite on Wednesday June 17, 2026 @11:46AM (#48572106)
Nice article! As someone who implemented both clustering and heatmaps in Mapbox / Maplibre GL JS, just wanted to add that clustering isn't just a visualization technique — it's also a performance feature that can support other visualization types. It might not matter for 30k points, but for e.g. 300k, you can implement dot density with stacked opacity via clustering — use a tiny clustering radius, and style the dots so that opacity is a function of point_count. This creates an approximation of an unclustered viz that performs much smoother. Same thing with heatmaps — you can define heatmap-weight as a function of clustered source's point_count, and it will look nearly identical (aside minor shifts) as the unclustered one, but perform much better.
Re:My Astrophotography in the Movie Project Hail Mary on Wednesday March 25, 2026 @12:37PM (#47519711)
Amazing achievement, congratulations! Can't seem to be able to read it though, it greets me with "Sorry, you have been blocked" CloudFlare page — is this a HN overloading the website, or did the host accidentally block IPs from Ukraine perhaps?
Re:MapLibre Tile: a modern and efficient vector tile format on Monday January 26, 2026 @12:05PM (#46768236)
You can read more about why most web maps are like this and a quest to fix this in this article: https://www.mapbox.com/blog/adaptive-projections
> Perhaps you see this conflict from the perspective of a sports fan

I see this from the perspective of a Ukrainian living in Kyiv. Your ignorance is mind-boggling, and after the laughable mention of "NATO biolabs" there's truly no sense in further conversation. These tinfoil-head "I do my own research" people are something else.

Russian war industry just burns reserves for nothing — hundreds of billions spent on missiles and long range drones didn't achieve any strategic objectives, all those expensive modern tanks, armored vehicles and artillery systems gets demolished by $500 drones, russian soldiers mass switching from military vehicles to donkeys, horses, bikes & buggies. Russia is no longer able to defend their vast territory against Ukrainian long range attacks so their oil refineries and military factories explode every day. 150k+ verified deaths (with names) already vastly exceed any russian wars since WW2 and we know there are many times more unverified ones.

Sevastopol nuclear base is irrelevant to modern warfare, and the fleet (both ships and subs) is either on the bottom of the sea (like the flagship Moskva) or gone to hiding in Novorossiysk because they can't defend against cheap Ukrainian naval drones.

Capture of cities not on the agenda — of course every time they fail spectacularly at something they'll claim they didn't plan it anyway, lol. They attempted and failed the capture of Kyiv, Kharkiv, Chernihiv, Sumy & Mykolaiv, then had to flee from Kherson & much of the Kharkiv oblast, and they are no longer strategically able to attempt capturing any more — only slow creep over obliterated rubble of small towns by sacrificing a thousand people a day in meat grinders.

I can't believe you can be so delusional, it's just amazing what russian propaganda does to people.

Soviet stockpiles nearly depleted, 1.5 million dead or wounded, Black Sea fleet practically destroyed, third of strategic bomber fleet destroyed, economy in downfall, no major cities captured in 4 years of all out war, gas and oil revenues plummeting, and there are STILL people saying “oh they just didn’t even start for real yet, just you wait”, gosh. Just laughable.
Yeah, I think I last updated that website even before I released the first version of Leaflet. Life is very hectic at the moment, but I do really want to get to it sooner than later and modernize everything.
Wrote it 14 years ago! https://github.com/mourner/suncalc/ It's a bit neglected but I'll do some upkeep shortly...
Author of Suncalc here — this is exactly the kind of stuff I love to see my code being used in, thanks for sharing!
Re:Observable Notebooks 2.0 Technology Preview on Tuesday July 29, 2025 @01:19PM (#44725983)
The updated syntax looks brilliant — can't wait to try it out by upgrading some of my older notebooks! I was worried about the future of Observable since the Canvas announcement — it felt like notebooks were being slowly phased out, but I'm glad to be proven wrong.

Any timeline on bringing the new format to the Web editor? For me, the biggest draw of Observable is being able to instantly start exploring and visualizing some data without ANY setup (creating some local files, installing dependencies, launching a dev server etc.) — just click "New notebook" and off you go, frictionless. I hope this remains a priority.

Also worth mentioning the data viz community aspect, which I used to enjoy a ton — it's a bummer that things like being able to follow certain users and see their new notebooks in a feed were phased out, and that trending notebooks are now hidden under the Help menu instead of being featured on the user's homepage. This might be one of the reasons I stopped coming back to the platform as often, although I realize building a community is very difficult and hard to monetize — just thought I'd share.

Re:Vector Tiles are deployed on OpenStreetMap.org on Thursday July 24, 2025 @09:50AM (#44670672)
Also worth checking out https://github.com/onthegomap/planetiler, which maybe a bit less mature, but is much faster than Tilemaker.
Wonderful project! One thing I wish the website would have is being able to find the right book to read out of this enormous list — e.g. showing / sorting by Goodreads ratings (which I realize you might not want to do), or at least having some kind of a "Featured" section with the most critically acclaimed / must read books of the project on one page.
Re:Skype Credit is no longer available on Monday December 09, 2024 @02:20AM (#42363734)
I used it extensively until Microsoft did that absolutely atrocious “redesign” that tried turning it from a messenger into a flashy social app, making it an unusable ugly mess. Telegram was just starting to grow but I had to switch.
The problem with map projections in the digital age is what works well on world scale doesn't on street scale and vice versa. As explained in detail in this post: https://www.mapbox.com/blog/adaptive-projections
Re:Netlify just sent me a $104K bill for a simple static site on Tuesday February 27, 2024 @04:19AM (#39521928)
Love Bunny too, wonderful service and great team. I wish there'd be an easy way to set up auto-deploy to Bunny Edge Storage on GitHub commit (to avoid doing so manually), but I guess it's not to hard to do through GitHub Actions.
Re:Mozilla names new CEO as it pivots to data privacy on Friday February 09, 2024 @07:52AM (#39314306)
Got a bunch of PRs adding missing terms after the article, nice :) Thanks for the mention!
A lovely map — thanks for using Leaflet and keeping that little Ukrainian flag in the corner! Probably needs an attribution for the map added too (looks like it's Carto with an OpenStreetMap-derived basemap).
Not too fancy, but I built a math model & interactive visualization of my parking spot to understand how to efficiently park there without bumping into anything: https://observablehq.com/@mourner/kinematics-of-reverse-angl...

Discussed on HN here: https://news.ycombinator.com/item?id=21891919

Re:Chrome Ships WebGPU on Thursday April 06, 2023 @09:03AM (#35467811)
I've been looking for a replacement to WebGL Stats for a long time — thank you so much for making it! This is indispensable.
To people missing the joke, this is a quote from ChatGPT that was asked to comment on Tauri in "Dev Mode", taken from comments here https://news.ycombinator.com/item?id=34972791

Older »