An array of three-axis magnetometers used for dynamic magnetic anomaly compensation are located at the corners of a parallelopiped, with pairs of magnetometer outputs used to derive a magnetic anomaly gradient vector used to compensate a compass and/or the output of a gyroscope in an inertial management unit. The system may be used in a neutrally buoyant remotely operated vehicle to permit ascertaining of course and position in the absence of surface control signals.