I can calutate the space diagonal of a cubic box using Pythagoras theorem twice. However, how can I find the space diagonal with trigonometry?
I tried this: A cubic box (picture) with sides $a$. The triangle in the bottom have hypotenuse $x$ \begin{align*} \cos(45^\circ)=\frac{a}{x} \\ x=\frac{a}{\cos(45^\circ)}=\sqrt{2}a \end{align*}
The triangle inscribed in the cube have height $a$ and base $x=\sqrt{2}a$. Call the space diagonal $y$ so \begin{align*} \cos(45^\circ)=\frac{x}{y} \\ y=\frac{x}{\cos(45^\circ)} = \frac{\sqrt{2}a}{\frac{\sqrt{2}}{2}}=2a \end{align*} This is wrong, what have I missed?