Skip to content
Donner's Daily Dose of Drama
Donner's Daily Dose of Drama
  • The Good
    • Blogging
    • Consumer Protection
    • Environment
    • Ethics
    • Geek’s Home
    • Lisa Lanett
    • Medfield
    • Music
    • Parenting and Technology
    • Travel
    • wow
  • The Bad
    • Business
    • Ebay
    • Investment
    • Job search
    • Personal Finance
    • Politics
  • The Ugly
    • Information Technology
      • Business Intelligence
      • Content Management
      • Free Software
      • I18N and L10N
      • Java
      • Open Source
      • Mobile Devices
      • Open Source Business Intelligence
      • OSBI
      • SDA
      • Security
      • Smartphone
      • Software Best Practices
      • Software Engineering
      • SQL Server
      • Streaming Media
      • Web
    • Austria
    • Fiction
    • Hardware
    • iPod
    • Miscellaneous
    • Uncategorized
    • Video
    • Weekend Warrior
Donner's Daily Dose of Drama

Stars: From a 64k Data Segment to the Browser

Christian Donner, May 27, 2026May 27, 2026

How a student project for Prof. Gerhard Fasching at the Technische Universität Wien — written in C for Windows 2.1 sometime around 1989 — found its way, more than three decades later, into a modern React application that anyone can open in a browser.

→ Open the live app at heeroz.com/stars


Vienna, late 1980s

I was an Electrical Engineering student at the Technische Universität Wien in the late eighties and early nineties — the era of MS-DOS, the first 80386 machines, and a fragile early Windows whose version number had only just ticked past 2. The Internet, for most students, was a rumor about something called USENET that the lucky ones could read on a VT220 in the basement of the Freihaus.

One of the most memorable lecturers of that period was Prof. Gerhard Fasching. He taught material science, a key subject for all EE students, with the kind of personal fervor that you remember even decades later, but his real passion was astronomy. He wrote books about it. Beautiful, careful books. The kind that put the constellations in their proper place not just on the sky but in cultural and scientific history. His “Sternbilderkunde: Himmelskarten, Himmelskörper, Sternbilder” sits on a lot of Austrian bookshelves to this day.

If you’ve ever had a professor whose enthusiasm for a topic was contagious enough to nudge you into spending an entire summer on a project that wasn’t strictly required, you know what I mean. For me that project was Stars.

The assignment that became a small obsession

I was looking for a way to earn academic credits and Prof. Fasching wanted a piece of software that could draw the night sky for any place on Earth, at any moment in time, in a way that he could actually use — to illustrate his lectures, and eventually to make the diagrams in his publications.

This was Windows 2.1, and shortly after Windows 3.0. There was no GDI+, no DirectDraw, no GPU. There was a 16-bit operating system on top of MS-DOS, a tiny set of GDI calls, and the unforgiving rule that every single data structure had to live inside a 64-kilobyte segment.

That last constraint is the one that defined everything else.

The 64k problem

The data set the app needed was the Yale Bright Star Catalog — roughly 9,000 stars down to about magnitude 6.5, with right ascension, declination, and magnitude for each one. The “obvious” representation is something like:

struct Star {
    double ra;     // 8 bytes
    double dec;    // 8 bytes
    float  mag;    // 4 bytes
};                 // = 20 bytes per star

9,000 stars × 20 bytes = 180,000 bytes. About three times what a 16-bit segment could hold. Game over.

So the records got squeezed. Hard.

  • Right ascension goes from 0 to 2π radians. Scale it to a 16-bit unsigned integer and you have a resolution of about 0.0001 radians — well below the size of a printed dot on any screen of the era.
  • Declination goes from −π/2 to +π/2. Offset it to start at the south pole and scale it the same way: another 16 bits.
  • Magnitude needs maybe 6 bits if you quantize in steps of 0.25 — plenty for a chart.

That gave a record like this:

struct Star {
    uint16_t raRaw;     // RA  = raRaw  * 0.00009584 rad
    uint16_t decRaw;    // dec = decRaw * 0.00009584 - π/2 rad
    uint8_t  magByte;   // mag = magByte * 0.25 (lower 6 bits)
};                      // = 5 bytes per star

9,000 stars × 5 bytes ≈ 45 KB. That left almost 20 KB of breathing room in the segment for constellation line tables, object indices, and a bit of working memory. The packing constants DECLEH = 0.00009584 and MAGNEH = 0.25 outlived everything else in the codebase — they’re still in the React version today, exactly as they were in the C of 1989.

It’s a small reminder of how much of early personal-computer software was really about negotiating with the hardware. The constellation lines were stored as pairs of 16-bit indices into the star array, four bytes each. The screen projection ran in fixed-point in the hot loop. None of that mattered to the user — they just saw a sky. But the design of the data file rippled through every part of the code.

Drawing the sky

The core of the app is the projection from the celestial sphere onto a flat screen. For a chart that looks like the view from a particular spot on Earth at a particular moment, you need to convert each star’s right ascension and declination into the observer’s azimuth and altitude. The trick is the local sidereal time, which tells you which slice of the sky is overhead right now:

LST = (1.002737909 · days_since_1900 + 0.274907) · 24h  (mod 24h)
    + local_time / 0.997269566 − longitude

Once you have LST you can compute the altitude h and azimuth A of any star with the standard horizon-coordinate transform:

sin h = sinφ · sinδ + cosφ · cosδ · cos(LST − α)

where φ is the observer’s latitude, δ the star’s declination, and α its right ascension. Project (h, A) onto a disc and you have the chart. Repeat for 9,000 stars, sixty times a second… well, not in 1989. Once per redraw was plenty.

From lecture-hall projector to printed page

What I didn’t quite expect was that Prof. Fasching wouldn’t just use Stars in his lectures — he started using its output as source material for his books. The clean line drawings of constellations that appear in his “Sternbilderkunde” volumes are, in a real sense, descendants of those 5-byte star records. For a student, seeing your code in the figures of a published academic book is a fairly intoxicating feeling, and one I never quite forgot.

The custom constellation files in the modern version still carry that history. There’s a FASCHING.KBI file alongside the standard set, holding the line work Prof. Fasching himself preferred — a slightly idiosyncratic take that emphasizes certain figures over the IAU defaults. It’s there because it was on the original disks, and it would feel wrong to lose it.


2026: a port to React

Fast-forward roughly 35 years. The C source still compiles, in a fashion, but Windows 2.1 hasn’t been a meaningful runtime in a very long time. I asked Claude (yes — the model that’s writing this very paragraph) to port the application to a modern environment. The goal was simple: keep the look, the math, and the data files exactly as they are, but make it open in any browser, on any device (to be fair, it is not optimized for mobile devices and works best on a desktop screen).

The new version is a single-page React + Canvas application. It loads the original STARS.BIN, OBJECTS.BIN, and CONTOUR.BIN files directly — no conversion step, no re-encoded JSON. The packing constants are unchanged. The projection math is a near line-for-line translation of the old C, with two notable additions:

  • Planets and the Sun, computed from the JPL approximate orbital elements (valid 1800–2050 to about arc-minute accuracy). Each frame solves Kepler’s equation E − e sin E = M by Newton iteration.
  • IP-based geolocation so that when you first open the page, the chart is already centered on your latitude and longitude. The original always opened on Vienna; the new one starts wherever you happen to be.

Everything else — the horizon disc, the cardinal directions, the dashed ecliptic and equator, the click-to-query star info, the constellation editor — is the same set of features the original Windows app had, just in a layout that suits a modern screen.


A short user’s guide

Getting your bearings

When you open heeroz.com/stars, you’ll see a black disc with stars on it. That disc is your local sky, projected as if you were lying on your back looking up. N is at the top, S at the bottom, and east is on the left and west on the right — because that’s how the sky actually looks when you’re facing south and tilt your head back. (If you’re in the southern hemisphere, the chart still works; just face north and reverse the mental image.)

A small line of text in the upper-left corner shows the date, time, latitude and longitude that the chart is drawn for.

The toolbar

Along the top you can toggle the visible layers:

  • Stars, Objects (deep-sky markers), Constellation lines, Star names.
  • Sun and Planets — drawn at their actual positions for the chosen instant.
  • Horizon (the white circle), N-S-E-W labels, Ecliptic (red dashed), Equator (blue dashed), and the Text overlay.

You can also pick the field of view from a row of preset buttons — anything from a wide 180° all-sky view down to a narrow zoom on a single constellation. Note that can you change the field of view in discreet steps with the mouse wheel, too.

The Settings panel

Open Settings on the side panel to control:

  • Maximum magnitude — the dimmest stars to show. 6.5 is roughly what a person sees on a dark night; 4 looks like a city sky.
  • Star size scaling — how aggressively brighter stars are drawn larger than dimmer ones.
  • Field of view in degrees, if you want something other than a preset.
  • Latitude and longitude — your location. In this app, negative longitude is east (an old astronomical convention the original code used; the modern version keeps it for fidelity to the data). Note that by clicking and dragging, you can change your location with the mouse. While in drag mode, a small map shows your current location.
  • Time zone meridian — which meridian your local clock is referenced to.
  • Date and time — any moment from the early 19th century through 2050 or so works fine. A Use Current Time button sets it to now.

Star Query

Click on any star in the chart. The Star Query panel shows its name (where one is recorded), Bayer/Flamsteed designation, parent constellation, catalog number, right ascension in hours, declination in degrees, and apparent magnitude.

The Constellation Editor

One of Prof. Fasching’s favorite features in the original: you can edit the line drawings yourself. Open the Constellation Editor, then right-click two stars in succession. The panel shows the pair and offers an Add Line or Delete Line button depending on whether that link currently exists. Your edits are persisted in the browser, so the constellation set you build up is yours, kept across sessions.

If you want to start from a different baseline, the Load Constellation section lets you pick from the original .KBI files — including FASCHING.KBI, the one Prof. Fasching himself maintained, and KOMPLETT.KBI, the densest, most exhaustive version.

Animation

The Animation panel can advance the sky in two different ways:

  • Time mode runs the clock forward (or backward) at a multiple of real time. At “1 hr/s” you watch a full night go by in about thirty seconds — the stars wheel around the pole, planets drift, the ecliptic tilts.
  • Longitude mode keeps the clock fixed and sweeps the observer eastward or westward around the globe. It’s a fast way to see how the same instant looks from very different places on Earth.

Negative speeds run things backwards. A small world-map overlay appears while you drag the chart, so you always know where on Earth you currently are.

View Variables

For the astronomically curious, the View Variables panel exposes the intermediate quantities used by the projection — days since 1900, Greenwich and local sidereal time, the observer’s longitude in hours, and so on. It’s the same set of values that the original C version printed in debug mode, more or less verbatim.


What stayed, what changed

It’s a strange thing to look at the source of a piece of software you wrote as a student and find that the bones of it are still the right bones. The two most consequential decisions of 1989 — packing each star into 5 bytes, and doing the horizon projection in closed form rather than via a 3D matrix pipeline — both survived the port without needing to be touched. The 64-kilobyte constraint that forced the packing is gone. The packing isn’t.

What did change is what’s around the core: a React UI instead of GDI, Canvas 2D instead of BitBlt, an IP geolocation lookup instead of a prompt for latitude and longitude, localStorage instead of an INI file, planets computed live from orbital elements instead of looked up in a printed almanac. The shape of the program is identical. The body around it is entirely new.

That feels right. Prof. Fasching’s astronomy didn’t change between 1989 and 2026 either — the stars are where they were, and the math that puts them on a chart is the math it always was. The software around them was always going to age. The Yale catalog wasn’t.

Open heeroz.com/stars, click around, build your own constellations. If you happen to have a copy of Prof. Fasching’s “Sternbilderkunde” on the shelf, load FASCHING.KBI and compare. The figures in the book really are drawn from the same star records that the app is using right now.

Related Posts:

  • My USPS Certified Mail Experience Explained
  • OpenVPN
  • The Voip.ms SMS Integration for Home Assistant
  • Computer Build 2025
  • The Great Cat Litter Poop Off

Miscellaneous

Post navigation

Previous post

Leave a Reply

Your email address will not be published. Required fields are marked *

Pages

  • About
  • Awards
    • TechnoLawyer
  • Contact Christian Donner
  • Project Portfolio
  • Publications
  • Speaking Engagements

Recent Comments

  • Ameet on The Voip.ms SMS Integration for Home Assistant
  • Jay Dee on The Voip.ms SMS Integration for Home Assistant
  • Christian Donner on The Voip.ms SMS Integration for Home Assistant
  • Jay Dee on The Voip.ms SMS Integration for Home Assistant
  • Christian Donner on Sealing a leaky cast-iron fireplace chimney damper

Tags

AHCI Amazon Android ASP.Net AT&T Droid Drupal email Error failure featured firmware Garmin Godaddy Google honda Internet Explorer 8 iPhone Lenovo Lisa Lanett Modules NAS Nexus One Paypal Performance Privacy QNAP raid RS-407 sauna Security spam SQL SR3600 Synology T-Mobile T430s transmission tylö Verizon Virus VMWare Windows 7 windows 8.1 Windows Mobile
  • About
  • Awards
    • TechnoLawyer
  • Contact Christian Donner
  • Project Portfolio
  • Publications
  • Speaking Engagements
©2026 Donner's Daily Dose of Drama | WordPress Theme by SuperbThemes