5
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ Replace $\sqrt{6}$ by $\sqrt{2}$ in the denominator, and write ${3\pi\over4}$ instead of $2.36$ radians. Otherwise everything is fine. $\endgroup$ – Christian Blatter May 5 '15 at 9:18
6
$\begingroup$

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.

$\endgroup$
  • 3
    $\begingroup$ You can write just \cos instead of \text{cos} to get the correct spacing: $\cos\theta$ vs. $\text{cos}\theta$. $\endgroup$ – Regret May 5 '15 at 8:39
  • 2
    $\begingroup$ Cool, I hadn't ever tried that. You learn something new everyday. $\endgroup$ – ಠ_ಠ May 5 '15 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.