Home▸Maritime & Naval Engineering▸Ship Navigation (2D): Dead Reckoning, Celestial Fix & GPS DOP

Ship Navigation (2D): Dead Reckoning, Celestial Fix & GPS DOP

A 2D chart-plotter lab: a dead-reckoning track that diverges from the true track by the actual current-drift vector, a celestial fix from three real spherical-trig intercepts, and a GPS fix whose precision comes from inverting the real satellite-geometry matrix.

Maritime & Naval Engineering2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-ship-navigation ↗ Open standalone

This 2D companion trades the 3D original's orbiting WebGL-textured chart for a plain, readable plotter view built to expose the actual numbers behind each method. A dead-reckoning track is integrated from ship speed and heading alone — exactly what a navigator without GPS can log — while a separate true track also integrates the current-drift vector, so the two visibly split apart by precisely the current's contribution rather than a scripted constant. In Celestial mode the fix comes from real spherical-trigonometry sights on three bodies (Sun, Polaris, Venus): each intercept a = (Ho−Hc)·60 nm is computed from an actual Hc = asin(sinφ·sinδ + cosφ·cosδ·cosLHA) altitude formula, and the three Lines of Position are intersected by least squares to plot the fix — drag the sextant-error slider and watch the fix visibly degrade. In GPS mode, satellites are placed at random elevation and azimuth and the real 4×4 satellite-geometry matrix is inverted to report an actual PDOP, not a fixed illustrative value.

⚙ Under the hood

2D chart-plotter lab: dead reckoning that genuinely diverges from a true track under current drift, a spherical-trig celestial fix from three real intercept lines, and a GPS position computed from actual satellite-geometry DOP.

celestial navigationdead reckoningGPSsight reductionmaritimedilution of precision

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

Frequently Asked Questions

How does the DR track differ from the true track here?

The true track integrates ship speed and heading plus the current-drift vector every step. The DR track integrates only speed and heading, exactly as a navigator without electronic aids would log it, so the gap between the two tracks is precisely the current's contribution, computed live rather than approximated by a fixed formula.

What makes the celestial fix "real" spherical trigonometry?

Each body's calculated altitude uses the standard navigational-astronomy formula Hc = asin(sinφ·sinδ + cosφ·cosδ·cosLHA), and its azimuth uses the matching formula for great-circle bearing. The intercept and the three-line least-squares fix are computed from those outputs, not hand-scripted.

How is PDOP actually computed in GPS mode?

Satellites get random elevation/azimuth, each contributes a row to a 4×4 geometry (design) matrix, and that matrix is inverted with Gauss-Jordan elimination. PDOP is the square root of the sum of the diagonal position-covariance terms — a textbook Dilution-of-Precision calculation that changes whenever you resample the constellation or change the tracked-satellite count.

Why do more tracked satellites usually lower PDOP?

More satellites generally give a richer, more evenly spread geometry matrix, which shrinks the inverted covariance terms. It isn't guaranteed for every random draw, which is exactly why the simulation recomputes PDOP from the real geometry instead of assuming it.