# How to find three angles of a point in 3D.

Let's imagine a point in 3D system that its distance of that point to the origin 1 unit.

If the coordinates of that points have been given as x = a, y = b, z = c.

How can we calculate three angles to xyz axises of a vector from origin to that point ?

• Hint: dot product relates to the cosine of an angle. – orion Apr 14 '18 at 7:38

The vector point coordinates are $OP=(a,b,c)$ then the angles with $x,y,z$ with unitary vectors $e_1=(1,0,0),e_2=(0,1,0),e_3(0,0,1)$ are given by the dot product

• $\cos \alpha = \frac{OP\cdot e_1}{|OP||e_1|}=OP\cdot e_1=a$
• $\cos \beta = \frac{OP\cdot e_2}{|OP||e_2|}=OP\cdot e_2=b$
• $\cos \gamma = \frac{OP\cdot e_3}{|OP||e_3|}=OP\cdot e_3=c$

I used a way finding the angle between two vectors.

angle = aCos ( (V1.V2) / (|V1|.|V2|)  )


When I want to calculate the angle of a point to x axis.

x Axis is

V1 = 1.i + 0.j + 0.k


The point is

V2 = a.i + b.j + c.k


This way I calculated correct solution.

• Looks the same with @gimusi 's answer. – Hope Apr 14 '18 at 8:16
• yes for $P(a,b,c)$ with $a^2+b^2+c^2=1$ $a,b,c$ represent the cos of the angles with the axes. – user Apr 14 '18 at 8:18

Suppose you have a vector $\vec v = xi+yj+zk$ where $i,j,k$ are the basis unit vectors then the angles $\alpha,\beta, \gamma$ of the vector to the $x,y,z$ axes respectively is given by ;

$\alpha = \frac{x}{\sqrt{x^2+y^2+z^2}} = \cos(a)\\\beta = \frac{y}{\sqrt{x^2+y^2+z^2}}=\cos(b)\\\gamma = \frac{z}{\sqrt{x^2+y^2+z^2}}=\cos(c)$

It follows that squaring the 3 equations and adding them results in

$\cos^2(a)+\cos^2(b)+\cos^2(c) =\alpha^2+\beta^2+\gamma^2 = 1$

Suppose angle of vector related to x axis is $\alpha$, related to y axis is $\beta$ and related to z axis is $\gamma$ then we have:

Due to presumption; $\sqrt {a^2+b^2+c^2}=1$

$1\times \ cos \alpha=a$

$1\times \ cos \beta=b$

$1 \times \ cos \gamma=c$