Step 1: Note both vectors have the same magnitude:
$|\vec a|^2=1+4+9=14$ and $|\vec b|^2=9+4+1=14$ — same components in different order, so equal length $\sqrt{14}$.
Step 2: Dot product by pairing matching components:
$1\cdot3+(-2)(-2)+3\cdot1=3+4+3=10$.
Step 3: Apply the cosine formula:
$\cos\theta=10/(\sqrt{14}\sqrt{14})=10/14=5/7$.