A smartphone has all the sensors: tilt, clock, camera. Even compass, though hardly needed. This should be enough to build an app to determine position at sea.
> Any navigation equipment that used electricity was prohibited, including all GPS sources, the Essex’s electronic Voyage Management System (VMS), and the computer-based celestial navigation software STELLA.
Cellphone clocks are quartz crystals. Ordinary quartz crystals have an accuracy of ±10 ppm. That's ±0.001%. That's plenty accurate unless you've been at sea for a long time. 10 ppm of a month is 26 seconds, during which time the equator rotates 12 km (6 arc minutes, 1.9 milliradians). That's not "a few degrees".
Of course if you have a GPS signal you can keep time to within nanoseconds, but I suppose we're assuming GPS is jammed.
Cellphone cameras typically have pixel pitch on the order of 250 microradians, but star trackers routinely deliver attitude information accurate to less than a tenth of a pixel, so 25 microradians, which is 5 arc seconds, not "a few degrees". Calibrating a star tracker for a mass-market camera with its nonlinear distortions is a pain in the ass but can be done. 25 microradians is 160 meters.
SatState from F-Droid shows that my cellphone's accelerometer (tilt sensor) seems to vary by ±0.01m/s² in each of its ≈200ms samples, which is about a milliradian of error, 40× worse than the camera error, about two weeks of clock drift. This isn't "a few degrees" either. Accelerometers can integrate over arbitrarily long periods of time to reduce noise; to reduce noise by 40×, assuming a Gaussian distribution, you need about 1600 samples (320 seconds, 5 minutes and 20 seconds) to average out to the same level as the camera error.
(It's easiest if the phone is sitting still during the averaging time, but both the gyros and the star tracker attitude information permit you to usefully average the accelerometer signal over time even when the phone is changing attitude.)
You probably do need to calibrate the angle between the accelerometer and the camera, but it probably won't change significantly over time for a given phone.
The clock seems like it could be the weak point here, but even the clock is only drifting a few hundred meters a day, and that only produces an east-west error.