Rotating a Reference Frame by another Reference Frame

52 Views Asked by At

I have a coordinate system defined by the unit vectors X = (1,0,0) and Y = (0,1,0).

I then have a reference frame defined by the orthogonal unit vectors P and Q. PQ describes a plane that is offset from the XY coordinate system (The plane is rotated and inclined).

Then, I have another reference frame, I and J. IJ describe a frame that is offset from PQ. IJ treats PQ as its "parent" frame, in the same way that PQ treats XY as its "parent" frame.

I need to produce a pair of vectors that describe I and J as they relate to the absolute reference frame, X and Y.

In fact, I need to be able to produce vectors describing reference frames of any level of depth. That is, I could have the reference frame AB, which is offset from IJ, which is offset from PQ, which is offset from XY - and so forth.

At first, I thought that simply summing and normalizing the series of parent vectors preceding the reference frame in question would do the trick, but it seems to be producing odd results.

For what it's worth (if you can't already tell), I am a programmer, not a mathematician. I appreciate the help!