Source TeX:
\cos(\frac{\pi}{4})= \dfrac{\text{adj}}{\text{hyp}}=\dfrac{a}{2}=\dfrac{\sqrt{2}}{2}