What I'm looking for is the trigonomery equations to calculate the x, y and z components of a 3D vector. What I mean:

The counterpart formulas for a 2D vector defined by 1 angle:

$x = \cos(\alpha)$

$z = \sin(\alpha)$

The counterpart for a 3D vector defined by 2 angles:

$x = \cos(\alpha) \cos(\beta)$

$z = \sin(\alpha) \cos(\beta)$

$y = \sin(\beta)$

So what I need is something along the lines of:

$x = \cos(\alpha) \cos(\beta) f(\gamma)$

$z = \sin(\alpha) \cos(\beta) g(\gamma)$

$y = \sin(\beta) h(\gamma)$

where $f(\gamma),g(\gamma),h(\gamma)$ are some functions of $\gamma$.

  • $\begingroup$ Please read this link to format math expressions. $\endgroup$
    – MonkeyKing
    May 8, 2015 at 19:28
  • $\begingroup$ any 3-D vector is defined by its magnitude $r$ its angle with $z$ axis and its angle with the $x-y$ plane. $\endgroup$ May 8, 2015 at 19:28
  • $\begingroup$ Although this does not answer your question, you might be interested in Euler angles. $\endgroup$
    – Lythia
    May 8, 2015 at 19:33
  • $\begingroup$ @MonkeyKing thanks, it's my first time. @ Lythia Hmm this might actually be usefull, looking into it. $\endgroup$ May 8, 2015 at 20:31

1 Answer 1


You can use the three angles between the vector $\mathbf{v}$ and the coordiante axes, defined by the direction cosines:

$$ \cos \alpha=\dfrac{\langle \mathbf{v},\mathbf{i} \rangle}{|\mathbf{v}|} $$

$$ \cos \beta=\dfrac{\langle \mathbf{v},\mathbf{j} \rangle}{|\mathbf{v}|} $$

$$ \cos \gamma=\dfrac{\langle \mathbf{v},\mathbf{k} \rangle}{|\mathbf{v}|} $$ so that you have: $$ \mathbf{v}=\begin{bmatrix}x\\y\\z \end {bmatrix}= |\mathbf{v}|\begin{bmatrix}\cos \alpha\\\cos \beta\\\cos \gamma \end {bmatrix} $$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .