Find a $3\times3$ orthogonal matrix $A$ . How can we find a $3\times3$ orthogonal matrix $A$ such that $$A\,\left[\frac{1}{\sqrt 2},\frac{1}{\sqrt 2},0\right]^T=\left[\frac{1}{\sqrt 3},\frac{1}{\sqrt 3},\frac{1}{\sqrt 3}\right]^T?$$
My try:I don't know how to proceed in order to get that matrix.Thank you 
 A: HINT
$A$ represents a rotation that takes a unit vector pointing at the corner of a unit square in the $(x,y)$ plane, to a unit vector pointing at the corner of a unit cube.  
Picture the geometry, and you will see that $A$ must represent a rotation about the axis $(y=-x,z=0)$.
A: step 1, Find an otho-normal matrix that maps one of your principle component vectors to $(\frac {1}{\sqrt 3},\frac {1}{\sqrt 3},\frac {1}{\sqrt 3})$
$(\frac {1}{\sqrt 3},\frac {1}{\sqrt 3},\frac {1}{\sqrt 3})$ can be our first vector.
a vector othogonal to that (but not necessarily normal) is (1,-1,0).
and vector to the otehr two (but not necessarily normal) is (1,1,-2).
Now that we have the orthogonal set of vector, we can divide each by their norms to get an ortho-normal set.
$\begin {bmatrix} 
\frac 1{\sqrt 3}& \frac 1{\sqrt 2} & \frac 1{\sqrt 6}\\
\frac 1{\sqrt 3}& -\frac 1{\sqrt 2} & \frac 1{\sqrt 6}\\
\frac 1{\sqrt 3}& 0 & -\frac 2{\sqrt 6}\end{bmatrix}$
This transform takes $(1,0,0)$ to $(\frac {1}{\sqrt 3},\frac {1}{\sqrt 3},\frac {1}{\sqrt 3})$  
So now we transform our vector $(\frac 1{\sqrt2},\frac 1{\sqrt2}, 0)$ to $(1,0,0)$ with an ortho-normal transformation.  And the product of the two, will do what we need it to do.
$\begin {bmatrix} 
\frac 1{\sqrt 3}& \frac 1{\sqrt 2} & \frac 1{\sqrt 6}\\
\frac 1{\sqrt 3}& -\frac 1{\sqrt 2} & \frac 1{\sqrt 6}\\
\frac 1{\sqrt 3}& 0 & -\frac 2{\sqrt 6}\end{bmatrix}\begin {bmatrix} 
\frac 1{\sqrt 2}& \frac 1{\sqrt 2} & 0\\
-\frac 1{\sqrt 2}& \frac 1{\sqrt 2} & 0\\
0& 0 & 1\end{bmatrix}=\begin {bmatrix} 
\frac 1{\sqrt 6}-\frac 12& \frac 1{\sqrt 6}+\frac 12 & \frac 1{\sqrt 6}\\
\frac 1{\sqrt 6}+\frac 12& \frac 1{\sqrt 6}-\frac 12 & \frac 1{\sqrt 6}\\
\frac 1{\sqrt 6}& \frac 1{\sqrt 6} & -\frac {2}{\sqrt 6}\end{bmatrix}$
