Simulating the Solar Eclipse From Anywhere in America
This is among my all-time favorite projects for the sole reason that it was the first time I made use of my (undeclared) minor in physics. This was also my first major foray into 3D graphics in the browsers.
Which wasn’t actually required, since the main portion of this feature showing the moon pass over the sun could have been accomplished with traditional two-dimensional graphics–basically a pair of circular images that move about the screen–so long as one did all the work to calculate where they would appear in the sky to an observer at a given location on Earth. I suspect this would have involved precalculating those figures for every ZIP code.
In fact, that might have been the only way to do this 10 or 15 years ago, before we could rely on the browsers on most devices to be able to handle 3D acceleration. Instead of programming a flat simulation, this feature is a live 3D model of the solar system. I can turn the camera in any direction and place the observer anywhere on Earth or in space. Which is why I was able to add a “Moon’s eye view” inset in the corner with minimal extra work.
What’s so much fun about this sort of programming is that the simplest way to accomplish the task at hand involves most of the knowledge and codebase necessary for a whole universe of other space-related projects. I’m eager to do Mars next.