Explanation of the problem:
I have a MATLAB program, which produces two vectors in a 3D coordinate system. The origin for both vectors is (0,0,0). The vector's endpoints are located on the unit sphere.
Now, I choose the vector with the higher Y-Value (could possibly be a different criteria), to be my initial vector. Based on that vector I want to find three new vectors, which are pointing towards the vertices of a regular tetrahedron. Another condition condition should be, that one of the three new vectors lays in the plane spanned by the two original vectors. Since the angle between two vertices in a regular tetrahedron is always constant (acos(-1/3) ~= 109.5 deg) it is also the smallest possible angle to the second original vector.
Attempts in solving the problem:
My first idea how to solve the problem was to define a matrix of the vertices as:
MT = [1, 1, -1, -1; 1, -1, 1, -1; 1, -1, -1, 1];
and then trying to rotate it into the right position, but my attempt did not work out.
My second idea was to define the second of the three new vectors as a linear combination of the two original vectors. I used the formula for finding an angle between two vectors and set the angle to acos(-1/3). After finding the second vector, I figured the two other ones would only be a multiplication with some kind of a transfer matrix. But I also got stuck on this attempt, since I never was able to find the second vector.
Now, I am running out of ideas. Please also note, that I would like the operations/ calculations in my program to be as high-performing as possible.
Thank you for your help. It is greatly appreciated.