Given two orthogonal unit vectors, A and B, and two different orthogonal unit vectors C and D, I need the 3x3 direction cosine matrix or a quaternion which will rotate A to align with C AND will rotate B to align with D.
The vectors are all 3-vectors (x, y, z).
I have a brute force algorithm, but I am almost certain there is a much simpler solution. And my web searches have not yet revealed one.
I am using C#, but if you have something in C, or FORTRAN, or Basic (etc.) I can convert it. Or, I can use the terms written out mathematically.
The application is determining the orientation needed for a spacecraft so an optical device attached rigidly to it will be properly aligned to take a picture. (Both the bore sight direction and the appropriate rotation of the optic device about bore sight must be attained, thus the need to align TWO vectors at once.) The computation may be used in a loop fed by real-time sensed data, and the brute force solution is too slow.