# How is the angle between 2 vectors in more than 3 dimensions defined?

I would like to know how the angle between two n-vectors is defined. I mean whether it is unique and how we may compute it (is the inner product a valid method in the n-dimensional space?). I have found very little information on this issue on the internet. Thanks

-
Did you want the acute angle or the obtuse angle (that is, if your vectors weren't perpendicular)? – J. M. Jul 23 '11 at 13:40
@J.M.: Did you mean the non-reflex ($0\le\theta\le\pi$) angle or the reflex ($\pi\lt\theta\lt2\pi$) angle? – Isaac Jul 23 '11 at 14:55
@Isaac: Tsk, I was thinking of "vertical angles" at the time I wrote the comment... so the first one, yes. – J. M. Jul 23 '11 at 14:57

## 3 Answers

In the $n$-dimensional real space the angle between two vectors is defined by the inner-product: $$\cos\theta=\frac{\langle v,w \rangle}{||v||\cdot||w||}$$ Where $||v||$ is the length of the vector.

-
I just want to point out that this is basically taking the Law of cosines and solving for the angle. – Willie Wong Jul 23 '11 at 13:25

If your two vectors $v$ and $w$ are not collinear then they span a two-dimensional plane $E\subset{\mathbb R}^n$. This plane inherits the given scalar product in ${\mathbb R}^n$ and so becomes an ordinary euclidean plane like the sheet of paper you are drawing on. The angles in this plane are related to the scalar product as they are in two-dimensional vector geometry, namely by $$\cos\bigl(\angle(v,w)\bigr)={\langle v, w\rangle\over|v|\ |w|}\ .$$

-
+1 this is the simplest explanation I've seen for why the law of cosines extends to higher dimensions. – R.. Jul 24 '11 at 2:43

While you can certainly compute the angle using the usual inner product formula, it's also possible and perfectly acceptable to use the same flavor of geometric definition of angles as is done in $\mathbb{R}^2$ and $\mathbb{R}^3$. Radially project two given nonzero vectors onto the unit sphere via the map $\vec{x}\to\vec{x}/\|\vec{x}\|$. Any two nonidentical points on a hypersphere determine a unique "great circle" containing both of them; the angle in radians can be defined as the length of the shorter arc between the two. (Of course, this raises the question, "How is arclength defined in higher dimensions?" - but this is moot given that the 2 and 3-dimensional definitions immediately generalize to any dimension.)

Demonstrating the inner product formula works in higher dimensions given this definition is fairly easy: the general idea is to use an orthonormal change-of-base matrix $M$ which takes the plane determined by the great circle containing two unit vectors to the $xy$-plane (inner products are unchanged under $M$'s action: $\langle Mx,My\rangle = \langle x,M^TMy\rangle = \langle x,Iy\rangle=\langle x,y\rangle$) and then the formula's validity is reduced to the two-dimensional case.

-
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}