A method for determining the orientation, relative to a vehicle, of an apparatus attached to the vehicle, the method comprising: periodically recording acceleration data of the apparatus along three mutually orthogonal axes at a first time interval; periodically recording speed and heading data of the apparatus at a second time interval; determining a first vector which corresponds to the direction of gravity using the acceleration data; identifying one or more periods of acceleration in a substantially straight line using the speed and heading data; selecting acceleration data corresponding to the identified one or more periods of acceleration in a substantially straight line; and determining a second vector which is orthogonal to the first vector and which corresponds to a forward direction of the vehicle using the selected acceleration data; wherein determining a second vector comprises: projecting the selected acceleration data onto a plane normal to the first vector; and using principal components analysis to determine a principal component vector of the projected selected acceleration data, wherein the second vector is the principal component vector; and characterised in that the method comprises: calculating a quality value as an indicator of the accuracy of the second vector, wherein the calculation of the quality value uses the dot product of the second vector with the projected values of the selected acceleration data on the plane normal to the first vector. periodically recording acceleration data of the apparatus along three mutually orthogonal axes at a first time interval; periodically recording speed and heading data of the apparatus at a second time interval; determining a first vector which corresponds to the direction of gravity using the acceleration data; identifying one or more periods of acceleration in a substantially straight line using the speed and heading data; selecting acceleration data corresponding to the identified one or more periods of acceleration in a substantially straight line; and determining a second vector which is orthogonal to the first vector and which corresponds to a forward direction of the vehicle using the selected acceleration data; wherein determining a second vector comprises: projecting the selected acceleration data onto a plane normal to the first vector; and using principal components analysis to determine a principal component vector of the projected selected acceleration data, wherein the second vector is the principal component vector; and characterised in that the method comprises: calculating a quality value as an indicator of the accuracy of the second vector, wherein the calculation of the quality value uses the dot product of the second vector with the projected values of the selected acceleration data on the plane normal to the first vector. projecting the selected acceleration data onto a plane normal to the first vector; and using principal components analysis to determine a principal component vector of the projected selected acceleration data, wherein the second vector is the principal component vector; and characterised in that the method comprises: calculating a quality value as an indicator of the accuracy of the second vector, wherein the calculation of the quality value uses the dot product of the second vector with the projected values of the selected acceleration data on the plane normal to the first vector.