# Rotation with roll pitch and yaw in different coordinate system

Say I am given a point in an x1,y1,z1 coordinate system. I have a different coordinate system, x2,y2,z2 that has the same origin as the x1,y1,z1 system, but the axis are not aligned. I have roll, pitch, and yaw sensors fitted on the x2,y2,z2 coordinate system.

This picture may help:

How do I go about transforming the point in x1,y1,z1 coordinates to x2,y2,z2 coordinates? My original thought was that I simply just rotate by "head" degrees about y1 by the heading first, then rotate by "roll" degrees about z, then rotate by "pitch" degrees about x. This seems too easy and direct. Is this the correct approach?

• If by skewed you mean rotated then you simply need to have the transformation matrix from the first basis to the second basis (which is built by the basis vectors of the second system expressed in the first as column vectors in the matrix). Then multiplying your point coordinates by that matrix you get the corresponding coordinates in the second system. – lightxbulb Mar 7 at 14:49
• Can you describe this process in greater detail? – user2913869 Mar 7 at 14:59
• en.wikipedia.org/wiki/Transformation_matrix – lightxbulb Mar 7 at 15:00