How do you factorise

$x^2 + y^2 + z^2 - 2xy - 2yz - 2zx$ ?

If those minus sings were pluses it would be a lot simpler. I wondered if there was some kind of use of imaginary units which would yield those minus signs.

The factorisation could be done by introducing 3 units, $i, j, k$ such that,

$$
i^2 = j^2 = k^2 = 1 \\
ij = jk = ki = -1
$$

which sort of look like quaternions, but not quite. In this case the factorisation becomes,
$$
x^2 + y^2 + z^2 - 2xy - 2yz - 2zx = (ix + jy + kz)^2.
$$

I didn't know if there was some algebra which obeyed these properties.