# Angle between two 4D vectors

I was wondering if there is any difference between finding the angle between two 4D vectors as opposed to finding the angle between two 3D vectors?

I have $u = (1, 0, 1, 0)$ , $v = (-3, -3, -3, -3)$ and used the dot product to find the angle between them. We have that:

$u\cdot v = -6$

$||u|| = \sqrt 2$

$||v|| = \sqrt{36}$

Then,

$$\cos(\theta) = \frac{u . v} {||u||\cdot ||v||}=\frac{-6 }{ \sqrt 6 \cdot \sqrt{36}} = -0.71,$$

so

$$\theta = \cos^{-1} (-0.71)$$

And the angle between $u$ and $v$ is $135$ degrees or $2.36$ radians.

• Replace $\sqrt{6}$ by $\sqrt{2}$ in the denominator, and write ${3\pi\over4}$ instead of $2.36$ radians. Otherwise everything is fine. May 5, 2015 at 9:18

In a vector space $V$ equipped with an inner product $\langle ~,~ \rangle$, the angle between two nonzero vectors $v, w \in V$ is defined the same way no matter what the dimension is. The dimension could be 1, 4, 1332, or literally infinite. The definition is:
$$\cos \theta = \frac{\langle v, w \rangle}{\|v\| \|w\|}$$
where $\|v\| = \sqrt{\langle v, v\rangle}$ is the norm or length of $v$.
• You can write just \cos instead of \text{cos} to get the correct spacing: $\cos\theta$ vs. $\text{cos}\theta$. May 5, 2015 at 8:39