Skip to content

xnetcat/astrolabe

Repository files navigation

Astrolabe

An augmented-reality sky instrument for iPhone — hold up your phone and see the Sun, Moon, planets, stars, and satellites exactly where they are, at any date in history or the future.

Astrolabe overlays the heavens onto your camera at their astronomically correct positions for your GPS location, using ARKit world tracking. Scrub through time to watch every body glide along its arc, jump to any date, and tap anything to inspect it — all wrapped in an iOS 26 Liquid Glass interface.

Astrolabe tracking the Moon, its trajectory arc, and constellations over a real skyline at dusk
The waxing Moon — phase, trajectory arc, and constellations — overlaid on the live camera at dusk.


Features

  • ☀️ Sun & Moon — correct positions, daily trajectory arcs, rise/transit/set, and a true-to-phase Moon disc.
  • 🪐 Every planet — Mercury through Neptune, with magnitude, distance, and per-body styling.
  • ~5,000 stars + constellations — a bundled bright-star catalog (to magnitude 6) with IAU constellation figures and an adjustable magnitude limit.
  • 🛰️ ISS & satellites — live orbital data propagated with SGP4; bright passes appear as labeled markers.
  • Time travel — a day scrubber and date picker move the whole sky; a "Now" button snaps back to real time.
  • 🧭 Compass calibration — drag-to-align or one-tap Align to Sun/Moon to correct for indoor magnetic interference.
  • 🔭 Find anything — search any body and follow a live on-screen arrow until you're pointed right at it.
  • 📋 Today timeline — twilight phases, golden hours, sunrise/sunset, moon events; tap an event to jump there.
  • 🌑 Modern Glass UI — Liquid Glass panels, colored per-body icons, immersive tap-to-hide mode, night mode.

Screenshots

Captured on a physical iPhone — AR world tracking isn't available in the Simulator, which renders the UI over a placeholder sky rather than the live camera.

Astrolabe AR view: the Moon with its phase disc, label, trajectory arc, twilight band, and constellation figures over a city skyline

The waxing-gibbous Moon is tracked over the real horizon with its phase disc, name label, and ecliptic arc; the rose twilight band hugs the horizon, the cardinal markers anchor the compass, and constellation figures (Lyra, Cygnus) recede into the dusk sky. The Liquid Glass status bar shows the live GPS fix and a north-pointing heading indicator; the time bar scrubs the whole sky with sunrise/sunset readouts.

Requirements

  • iOS 26+ (the UI is built on the Liquid Glass APIs).
  • Xcode 26 with the iOS 26 SDK.
  • A physical iPhone for the full experience — ARKit world tracking (worldAlignment = .gravityAndHeading) is not available in the Simulator, which shows the UI over a gradient sky only.
  • XcodeGen to generate the Xcode project.

Building

# 1. Install the project generator
brew install xcodegen

# 2. (Optional) Run the astronomy/SGP4 test suite on macOS — no device needed
cd AstrolabeCore && swift test && cd ..

# 3. Generate and open the Xcode project
xcodegen generate
open Astrolabe.xcodeproj

Then in Xcode:

  1. Select the Astrolabe target → Signing & Capabilities → set your Development Team.
  2. Choose your connected iPhone as the run destination and press Run.
  3. On first launch, trust the developer certificate on the device under Settings → General → VPN & Device Management.

The app's bundle identifier is com.xnetcat.astrolabe (change it to your own reverse-DNS id for distribution). The project is generated from project.yml — edit that, not the .xcodeproj.

Architecture

Astrolabe is split into a pure, well-tested computation core and a thin presentation layer.

  • AstrolabeCore — a dependency-light Swift package with no UIKit/ARKit/SwiftUI imports, fully unit-tested on macOS (30 tests):
    • AstronomyEngine — Sun/Moon/planet positions, rise/set/transit, twilight, golden hour, and Moon phase, wrapping SwiftAA (Meeus / VSOP87 / ELP-MPP02).
    • SkyProjection — maps horizontal coordinates (azimuth/altitude) to ARKit world-space positions.
    • StarCatalog — loads the bundled star + constellation data and projects it with a fast batch transform validated against SwiftAA.
    • SGP4 — a near-Earth SGP4 satellite propagator + TLE parser, validated to sub-kilometer accuracy against the canonical Spacetrack Report #3 reference vectors.
  • The app (SwiftUI + ARKit/SceneKit) — ARSceneController runs an ARSCNView with worldAlignment = .gravityAndHeading and renders celestial markers as emissive SceneKit nodes; the chrome is iOS 26 Liquid Glass. State flows through small @Observable controllers (TimeController, SettingsStore, LocationProvider, SkyModel).

A note on accuracy

The astronomy is sub-arcminute — far more precise than you can point a phone. The real limit is the device magnetometer (compass), typically ±5–15°, especially indoors near steel and reinforced concrete. That's why calibration is a first-class feature: Align to Sun/Moon reads the camera's true-north heading from ARKit and corrects the whole sky against a body you can actually see, bypassing the compass entirely.

Credits & data sources

  • SwiftAA by Cédric Foellmi — astronomical algorithms (MIT).
  • Star & constellation data from d3-celestial by Olaf Frohn — bundled stars.json / constellations.json derive from it (BSD-2-Clause).
  • Satellite TLEs from the tle.ivanstanojevic.me API.
  • SGP4 from Spacetrack Report #3 (Hoots & Roehrich) / Vallado's Revisiting Spacetrack Report #3.

See NOTICES.md for full attributions.

License

MIT © 2026 Jakub Kot (xnetcat)

About

iOS 26 augmented-reality sky instrument — overlays the Sun, Moon, planets, ~5000 stars, constellations, and satellites onto the live camera at astronomically correct positions, with a time-travel scrubber and Liquid Glass UI.

Topics

Resources

License

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors