Any vehicle such as a vessel or aeroplane has three attitude parameters. These are most commonly defined as pitch, roll and heading from true north. In hydrographic surveying, determination of these parameters is essential for the correction of multi-beam echo sounder measurements. In the study on which this paper is based, two of the three parameters, the pitch and roll angles, were measured with an inexpensive IMU (Inertial Measurement Unit) device. The third was calculated from GPS carrier phase measurements that were collected from two antennas on the boat. The GPS antennas depart from the vertical when they are subject to pitch and roll effects. In this case, the coordinates derived from GPS will be erroneous. Thus, if heading is to be calculated accurately, the horizontal coordinates have to be corrected for pitch and roll. This paper defines an algorithm for the purpose that enables pitch and roll angles to be measured with an accuracy of about 0.110 arcdeg and headings computed with an accuracy of about 0.010 arcdeg.