$1.$Find the axis and rotation angle of $T$ such that $T(v)=w$, for $v=(2,0,2)$ and $w=(0,2,-2)$. In case there is not such rotation, explain why.
$2.$ Say if it is possible to define a rotation $A$ about some axis passing through the origin such that $A(1,1,1)=(0,\sqrt 2,1)$.
I took the rotation about the $X,Y$ and $Z$ axes but it did not work. There is a general formula, I would like to know if there is another way to solve that kind of exercise
Knowing how to do this exercise I can try this other one.
Thank you!
For (1), since both the vectors have the same magnitude, such a rotation is possible. To get the axis about which to rotate, one possibility is on that is perpendicular to both vectors. This is because in moving from one vector to the other, we stay in the plane defined by them. So, the axis is just the cross product of $v$ and $w$.
Now for the angle, it is easy to find the angle between two vectors. This is given by:
$$\cos(\theta) = \frac{v.w}{||v|| ||w||}$$
For an implementation in python, check out this library (rotate_vec2vec method): https://github.com/ryu577/pyray/blob/master/pyray/rotation.py