# Find the angle between two vectors after rotating it.

Let's say we have a vector $D=(\sqrt2, 0, 0)$ and we do the following operations on it.

1) Rotate it in the clockwise direction against the $X$ axis for $\pi/4$

2) Rotate it in the counter clockwise direction against the $Y$ axis for $\pi/4$

that's the vector $D1$, we then perform steps 1 & 2 but we reverse the order, i.e. 1 would be counter clockwise and 2 would be clockwise; that's vector $D2$.

What's the angle that $D$ forms with $D1$ and $D2$?

From my calculations if we rotate it for the same amount in both axis it would still retain the $\pi/4$ span against both cases would it not?

-

Hint : Use rotation matrix to determine the new position of the vectors . For example along $z$ axis $$x' = x \cos \theta - y \sin \theta$$ $$y' = x \sin \theta + y \cos \theta$$ $$z' = z$$ along $x$ axis $$y' = y\cos \theta - z \sin \theta$$ $$z' = y\sin \theta + z\cos \theta$$ $$x' = x$$ , where $\theta$ is the angle and so on ...