cos(a) = , where x and y are two given vectors in 4D-space; the numerator of the formula is their scalar product and |x| and |y| are the lengths of these 4D vectors.