Is there a unified explanation to the following phenomena?
1) $\mathbb{R} [X, Y] / (X^2 + Y^2 - 1)$ is not a UFD.
2) $\mathbb{C} [X, Y] / (X^2 + Y^2 - 1)$ is a UFD.
3) $\mathbb{R} [X, Y, Z] / (X^2 + Y^2 + Z^2 - 1)$ is a UFD.
4) $\mathbb{C} [X, Y, Z] / (X^2 + Y^2 + Z^2 - 1)$ is not a UFD.
I guess that
1) holds as we can regard $\mathbb{R} [X, Y] / (X^2 + Y^2 - 1)\cong \mathbb{R} [\sin \theta, \cos \theta]$ by setting $X = \sin \theta$ and $Y = \cos \theta$,
2) holds as we can regard $\mathbb{C} [X, Y] / (X^2 + Y^2 - 1)\cong \mathbb{C} [t, t^{-1}]$ by setting $t = X + iY$.
But my guess does not look promising to show that 3) and 4) hold.