Star Tracker — attitude from the sky
A star tracker is the most accurate attitude sensor ever flown — arc-second class. It photographs a patch of sky, finds the stars, matches their pattern to an onboard catalog, and solves for the camera's absolute 3-axis orientation. No drift, no external signal, just geometry and starlight.
Symbols used on this page are defined in the Nomenclature → attitude & rotations.
The pipeline
1 · Centroiding
Each star is a blurred blob spread over several pixels. The sub-pixel centroid is the intensity-weighted mean — this is what gives arc-second accuracy from a coarse detector:
$$ u_c = \frac{\sum_{i} I_i\,u_i}{\sum_i I_i},\qquad v_c=\frac{\sum_i I_i\,v_i}{\sum_i I_i} $$2 · Star identification
The key insight: the angular separation between two stars is invariant to rotation. Compute the inter-star angles $\cos\theta_{ij} = \hat{\mathbf b}_i\cdot\hat{\mathbf b}_j$ from the centroids, and match that set of angles against a precomputed catalog of star-pair angles. A handful of matched pairs uniquely identifies the field ("lost-in-space" solved by pattern matching).
3 · Attitude determination (Wahba's problem)
Given $\ge 2$ matched stars — measured body-frame unit vectors $\hat{\mathbf b}_i$ and catalog inertial-frame vectors $\hat{\mathbf r}_i$ — find the rotation $R$ minimizing
$$ J(R)=\tfrac12\sum_i w_i\,\lVert \hat{\mathbf b}_i - R\,\hat{\mathbf r}_i\rVert^2 $$Solved in closed form by QUEST / the SVD of the attitude profile matrix $B=\sum_i w_i \hat{\mathbf b}_i \hat{\mathbf r}_i^\top$. The output is absolute orientation with no accumulated error.
The solve's conditioning is as important as its noise. Below, stars are matched between the catalogue and the body frame; adding stars averages the noise down as $1/\sqrt N$, but the rotation about the boresight is fixed only by the angular spread. Shrink the spread and roll becomes nearly unobservable — the same geometry effect as GDOP in GNSS:
Try it — rotate the camera
The simulation images a synthetic star field, connects the brightest triangle (the matched pattern), and reports the recovered attitude. Rotate the camera roll and note that the identified constellation tracks the rotation while the pattern (the angles) stays matchable; raise the centroid noise to see accuracy degrade:
Related: IMU · EKF · the same centroiding + matching ideas appear in the visual features used by DINOv2.