← Back to Blogs
HN Story

Visualizing the Earth's Rotation: The Engineering Behind Zenith

May 16, 2026

Visualizing the Earth's Rotation: The Engineering Behind Zenith

For most of us, the rotation of the Earth is an abstract concept—something we learn in primary school but rarely feel. While we know the stars move across the night sky, the motion is so gradual that it feels static. To truly perceive the Earth's spin, one typically needs a telescope without a tracking mount, where a star will visibly drift out of the field of view in a matter of seconds.

Zenith is a project designed to bring this visceral experience to the browser. By creating a live, local-first, fixed-viewport planetarium, Zenith zooms in on the sky to such an extent that the Earth's rotation becomes an immediate, visible motion. It transforms the celestial sphere into a "personal ribbon" of stars that sweeps across the screen in real-time.

The Geometry of the "Personal Ribbon"

To make the Earth's rotation visible, the developer defined the field of view (FOV) based on a specific temporal goal: the amount of sky that turns in 30 seconds should span the entire screen.

This resulting FOV is incredibly narrow—approximately 180x magnification. To put this in perspective, the author describes the view as being the size of a "grain of rice held at arm's length." Because the viewport is so slim, the experience is hyper-local. While people at the same latitude see the same sequence of stars (the same "movie"), they see them at different times based on their longitude. Conversely, someone just five miles north or south will see a completely different ribbon of stars.

Technical Implementation

Building a real-time celestial viewer in a browser requires a synthesis of high-resolution astronomical data and efficient client-side rendering.

Data Sources and Resolution

Zenith utilizes images from the Pan-STARRS1 data set (collected between 2010 and 2014), hosted by the Space Telescope Science Institute (STScI). The choice of Pan-STARRS was driven by the need for specific resolution and coverage. For a standard 1,000-pixel wide browser window, Pan-STARRS provides a resolution of 0.26 arcseconds per pixel, resulting in a field of view of roughly 4.33 arcminutes—exactly what is needed to make the rotation visible.

Tiling and Rendering with Leaflet.js

Interestingly, Zenith uses Leaflet.js, a library typically reserved for 2D Earth maps. While the celestial sphere is spherical and the motion is rotational, at the extreme zoom levels used by Zenith, the curvature is negligible. The developer treats each tile as a rectangle and the motion as linear, allowing Leaflet to handle the layering of Pan-STARRS images, coordinate grids, and object labels.

Object Identification

To provide context to the obscure patches of sky being viewed, Zenith queries the SIMBAD astronomical database. This allows the application to overlay the names of stars and nebulae onto the live feed. The developer noted a surprising level of precision: SIMBAD crosshairs align with Pan-STARRS images down to the pixel, despite coming from entirely independent sources.

Challenges in Image Processing

Raw astronomical data is rarely "camera-ready." Zenith implements a two-step client-side processing pipeline to clean the images:

  1. White Edge Removal: Cleaning up incomplete tiles that exhibit white sections along the edges.
  2. Noise Filtering: A threshold function with aggressive settings to remove background noise.

One persistent challenge remains: oversaturation. Because Pan-STARRS was designed for detecting moving objects (like near-Earth asteroids) and deep-field sensitivity, brighter stars often blow out the sensor. This results in "green blobs" in the center of stars. The developer is currently exploring topology-based solutions to identify and correct these artifacts without draining the color from actual red stars.

The Human Element: Perspective and Scale

The technical achievement of Zenith is not just in the rendering, but in the shift of perspective it provides. The project echoes a common experience among amateur astronomers: the moment a tracking mount fails, and the observer realizes the star isn't moving—they are.

This sentiment is echoed in the community discussions, with users noting that similar effects can be achieved in nature. One user described the experience of watching the moon partially obscured by a sharp mountain peak in the Alps or Rockies, where the relative motion becomes strikingly apparent.

By projecting Zenith onto a ceiling, the project turns a room into a living observatory, removing the barrier of expensive equipment and allowing anyone to feel the Earth's rotation in real-time.

References

HN Stories