It would have been nice for the author to get into or link to a description of the convex hull algorithm since that was the speed up magic. Since they didn't: https://en.wikipedia.org/wiki/Convex_hull_algorithms
https://chalkdustmagazine.com/blog/sylvesters-convex-hull-pr...