How Do Star Map Apps Work? Sensors, Catalogs and Math
Hold a phone up to the night sky and it names the star you are pointing at. Behind that trick sit four sensors, a star catalog of thousands of entries and a formula that sky watchers would have recognised centuries ago.

Key takeaways
- A star map app combines your GPS position and the exact time to work out which stars are above you, then uses the compass, accelerometer and gyroscope to work out where the phone points.
- The star positions come from catalogs such as Hipparcos and Gaia; planets and the Moon come from orbital models. That part is accurate to far better than a degree.
- The weak link is the phone compass. Metal and magnets can push the overlay several degrees off, so calibrate and check against a known bright star.
Star map apps work by answering two questions many times a second: what is above this place right now, and which way is the phone facing? The first answer comes from GPS, the clock and an astronomical catalog. The second comes from the phone's motion sensors, fused into a single estimate of orientation. Put the two together and the app draws the slice of sky that lines up with the screen.
None of the astronomy is secret. The catalogs are public and the formulas are taught in introductory courses. Most of the work in building one of these apps is software engineering: smoothing noisy sensors, rendering thousands of points at 60 frames per second and keeping it all working offline in a dark field. Small teams that need the same sky app on iPhone and Android often bring in a react native development company for the shared interface, and keep the sensor and rendering code in fast native modules.
Below we follow the data from sensor to screen, then show how to test an app against the real horizon, as sky watchers at Chaco Canyon and in the Yucatán once did with the Sun. If you want the hand-calculation version first, read how to calculate sunrise azimuth.
Which phone sensors does a star map app use?
A star map app uses four sensors: a satellite positioning receiver, a magnetometer, an accelerometer and a gyroscope. Each one answers a different part of the question, and none is good enough on its own.
| Sensor | What it measures | What the app gets from it | Main weakness |
|---|---|---|---|
| GPS (or other satellite systems) | Latitude, longitude, elevation and very precise time | Which part of the sky is above you | Slow first fix in canyons or under cover |
| Magnetometer | Direction and strength of Earth's magnetic field | Compass heading | Disturbed by metal, magnets and electrical lines |
| Accelerometer | Gravity and linear acceleration | Tilt: which way is down | Confused by shaking and walking |
| Gyroscope | Rate of rotation on three axes | Smooth, fast tracking as you sweep the phone | Drifts slowly over time |
Location does not need to be exact. A position within a few kilometres changes star positions by a hair, so even a Wi-Fi estimate works. Time matters more: an error of four minutes moves the whole sky by about one degree.
How does the app know where the phone is pointing?
The app knows where the phone points by combining tilt from the accelerometer, heading from the magnetometer and rotation from the gyroscope into one orientation estimate. This step is called sensor fusion.
Each sensor covers another's weakness:
- The accelerometer feels gravity, so it knows which way is down and how far the phone is tilted toward the zenith.
- The magnetometer knows which way magnetic north lies, which fixes the heading around the horizon.
- The gyroscope reacts within milliseconds when you turn, so the chart follows your hand without lag or jitter.
A filter blends the three. The gyroscope handles quick movement, while the slower but steadier accelerometer and magnetometer keep pulling the estimate back so the gyroscope's drift never builds up.
Both main phone platforms do this in the operating system: Android offers a rotation vector sensor and iOS offers Core Motion, which can report attitude relative to true north. The result is a rotation that tells the app exactly how the screen sits in space.
Magnetic north is not true north
A compass points to magnetic north, but star charts are built on true north, the direction of Earth's rotation axis. The angle between them is called magnetic declination, and it changes with place and year. In northwestern New Mexico it is currently several degrees east. Good apps correct for this using the World Magnetic Model; you can look up your own value with the NOAA magnetic field calculator.
Where do the star positions come from?
Star positions come from astronomical catalogs that list each star's coordinates, brightness and colour. The app stores a catalog on the phone and draws the entries bright enough to matter.
The catalogs grow with each generation of survey:
- Yale Bright Star Catalogue: about 9,100 stars down to magnitude 6.5, roughly everything visible to the naked eye from a dark site.
- Hipparcos: about 118,000 stars measured by a European Space Agency satellite in the early 1990s.
- Tycho-2: about 2.5 million stars, enough for binocular and small-telescope users.
- Gaia: positions for more than 1.8 billion sources in its third data release, from the ESA Gaia mission.
Most apps ship the brighter catalogs and download deeper ones on request. Stars are listed in right ascension and declination, a grid fixed to the sky rather than to the ground, so the same numbers work for every user on Earth.
Planets, the Moon and satellites move
Planets and the Moon are not in a fixed catalog. Apps compute them from orbital models such as VSOP87 or the JPL Development Ephemerides, which give positions for any date past or future. Artificial satellites, including the International Space Station, are the exception: their orbits change, so apps download fresh orbital elements every few days. Without a connection, satellite passes go stale first.
How is a star's position turned into a spot on your screen?
The app converts each star's sky coordinates into altitude and azimuth for your place and time, then projects those onto the screen using the phone's orientation. The process has four steps:
- Find local sidereal time. From the clock and your longitude, the app computes which line of right ascension is crossing your meridian. A sidereal day lasts about 23 hours 56 minutes, which is why stars rise four minutes earlier each night.
- Compute the hour angle. Subtracting the star's right ascension from local sidereal time gives how far it has turned past the meridian.
- Convert to altitude and azimuth. Spherical trigonometry with your latitude turns hour angle and declination into height above the horizon and compass bearing. Altitude comes from sin(alt) = sin(lat)·sin(dec) + cos(lat)·cos(dec)·cos(hour angle).
- Project onto the screen. The orientation rotation from sensor fusion maps each altitude and azimuth to a pixel, with a field of view that matches the zoom.
Better apps add small corrections. Atmospheric refraction lifts objects near the horizon by about half a degree, enough to change when the Sun appears to rise. Precession, nutation and aberration shift star positions slightly from their catalog values.
The same chain, minus the sensors, is what our Chaco sky viewer uses to show sunrise along a real horizon.
How accurate are star map apps?
The computed positions are very accurate, but the live overlay is only as good as the compass. Expect the chart to be right and the pointing to be roughly right.
| Part of the chain | Typical accuracy | What affects it |
|---|---|---|
| Star positions from catalog | Far below one arcsecond for Hipparcos and Gaia stars | Almost nothing in normal use |
| Planet and Moon positions | Arcseconds to a few arcminutes, depending on the model | Simplified models in lightweight apps |
| Sky at your time and place | Excellent if the clock and location are right | Wrong time zone or manual time setting |
| Live pointing overlay | Often within a few degrees; sometimes 10° or more off | Metal, magnetic cases, poor calibration |
For identifying a constellation, a few degrees does not matter. For checking whether a doorway or wall faces a solstice sunrise, it matters a great deal. Even near the equinoxes, when it moves fastest, the Sun's rising point shifts only about half a degree a day at the latitude of Chaco, so a 3° compass error equals almost a week on the calendar.
Common causes of a wrong overlay
- A phone case with a magnetic clasp or a car mount magnet.
- Standing next to a vehicle, a metal railing or an overhead power line.
- Skipping calibration after a flight or a long time in a bag.
- A phone clock set by hand instead of automatically.
How do you test a star map app at an ancient site?
Test a star map app by checking it against a target whose position you already know, and by replacing the flat horizon with the real one. Follow these steps:
- Calibrate away from metal. Walk a few metres from the car, remove magnetic cases and move the phone in a slow figure-eight until the app reports good accuracy.
- Check a known object. Point at a bright planet, the Moon or a star such as Polaris. If the label sits off the object, note the error in degrees.
- Use a map bearing for structures. For a wall or window, take its azimuth from a survey or satellite map rather than from the phone compass.
- Add the horizon profile. Mesas, cliffs and ridges delay sunrise and shift where it appears. Some planetarium apps accept a custom horizon panorama.
- Compare with published work. Alignment claims at Chaco and in the Maya region have been measured with surveying instruments; check your result against those studies before drawing conclusions.
Treat the app as a helper, not as evidence. The sun watchers of Pueblo communities and Maya astronomers built their knowledge over generations of careful observation from fixed places, and those traditions continue today. For the full method of dating a sky, see our guide to simulating the ancient sky in planetarium software.
Can a star map app show the sky as it was a thousand years ago?
Many planetarium apps can show the sky on a past date, but only the more serious ones apply all the slow changes correctly. The sky over Pueblo Bonito in 1100 CE was not quite today's sky.
- Precession: Earth's axis traces a circle every 25,800 years or so, moving the celestial pole about one degree every 72 years. A thousand years ago Polaris sat several degrees from the pole, not under half a degree as now.
- Proper motion: nearby stars drift across the sky. Arcturus moves about 2.3 arcseconds a year, roughly 0.6° in a thousand years.
- Obliquity: the tilt of Earth's axis was a little larger, which moved solstice sunrise slightly farther north than today.
- Earth's rotation: the day has lengthened slowly, so the exact clock time of a past event carries a correction called ΔT.
For constellations, the differences are small. For solstice alignments they are measurable, which is why archaeoastronomers compute the ancient Sun rather than reading it from a modern phone. Our article on augmented reality at archaeological sites shows where these sky models are now being placed over the ruins themselves.
What should you look for in a star map app?
Look for an app that works offline, corrects for declination and lets you control time and the horizon. A short checklist:
- Offline catalogs so the chart works without signal in remote parks.
- Red night mode on every screen, so your eyes stay dark-adapted.
- Time travel backward and forward, ideally with precession applied.
- Custom horizon support for real skylines.
- Calibration status shown clearly, so you know when pointing is unreliable.
- Clear privacy terms, since these apps read your precise location.
Teachers choosing an app for a class will find specific picks in our guide to astronomy apps for students.
Frequently asked questions
Do star map apps need an internet connection?
Most do not. The star catalog and the position math are stored on the phone, and GPS works without mobile data. You need a connection only for downloads such as satellite orbits, new comets, photos and descriptions.
Why is my star map app pointing at the wrong part of the sky?
Usually the compass is off. Metal, magnets in a phone case, car bodies and power lines bend the magnetic reading. Move away from metal, calibrate by turning the phone in a slow figure-eight, and check the app against a bright star or planet you can name.
How accurate are star map apps?
The computed positions of stars and planets are accurate to a tiny fraction of a degree. The on-screen overlay is less accurate because phone compasses are often a few degrees off, so treat the live view as a pointer and the chart itself as the reference.
Can a star map app show the sky over an ancient site centuries ago?
Some can. Desktop and mobile planetarium programs such as Stellarium let you set a past date and apply precession and star proper motion. For alignment work, also enter the real horizon profile and check results against published studies.
Do star map apps use the camera?
Most live sky views rely on the GPS, magnetometer, accelerometer and gyroscope, not the camera. Some apps show a camera feed behind the chart, and a few plate-solving tools analyse a photo to identify the exact star field.



