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.
Best Answer
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$.
In case you haven't heard the term, an inner product is just a generalization of the Euclidean dot product that can be defined on any vector space.