Angle from points coordinates in n dimensions

52 Views Asked by At

In $n$ dimensions, given three points $a : (a_1, \cdots, a_n)$, $b : (b_1, \cdots, b_n)$, and $c : (c_1, \cdots, c_n)$ ; what is the formula to get the value of the angle $\widehat{abc}$ in radians ?


This questions has been asked before, but either with specific coordinates, or with a fixed number of dimensions. Thus the previous instances fail to provide a general answer, hence the justification to ask the question again in general terms

1

There are 1 best solutions below

3
On BEST ANSWER

My attempt:

Let $\vec{ba}$ be the vector defined by the points $b$ and $a$, and $\vec{bc}$ defined by the points $b$ and $c$. Thus, $$ \vec{ba}=(a_1,\ldots,a_n)-(b_1,\ldots,b_n)=(a_1-b_1,\ldots,a_n-b_n);\\ \vec{bc}=(c_1,\ldots,c_n)-(b_1,\ldots,b_n)=(c_1-b_1,\ldots,c_n-b_n).$$ Let $\theta$ be the angle between $\vec{ba}$ and $\vec{bc}$, which is the angle $\widehat{abc}$. We know that $$\theta=\cos^{-1}\left(\frac{\vec{ba}\cdot\vec{bc}}{\|\vec{ba}\|\|\vec{bc}\|}\right).$$ Therefore, $$\boxed{\theta=\cos^{-1}\left(\frac{(a_1-b_1)(c_1-b_1)+\cdots+(a_n-b_n)(c_n-b_n)}{\sqrt{(a_1-b_1)^2+\cdots+(a_n-b_n)^2}\sqrt{(c_1-b_1)^2+\cdots+(c_n-b_n)^2}}\right)}.$$