Please, explain these computations:
1) $-\left(\frac{1}{2}\right)^2 +1 = \cos^2x$
$\frac{\sqrt{3}}{2} = \cos x$
How did we get $\frac{\sqrt{3}}{2}$ from $-\left(\frac{1}{2}\right)^2 +1$?
2) $-\left(\frac{\sqrt{2}}{2}\right)^2 +1 = \cos^2x$
$\frac{\sqrt{2}}{2} = \cos x$
How did we get $ \frac{\sqrt{2}}{2}$ from $-\left(\frac{\sqrt{2}}{2}\right)^2 +1 $?