{ A huge thanks to Nicolas Gallagher for providing all the math and inspiration for this. }