Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have a vector whose starting end is the origin & the other end can be in any of the 8 quadrants (in 3d).

I can easily get direction ratios for the vector & also know in which quadrant the vector ends (from ($x$, $y$, $z$) value of end point).

From this I think we can calculate the inclination of the vector with the three axes. but it gets very complicated because $\cos(A) = \cos(-A)$ & $\cos(A) = -\cos(\pi + A)$. I just want the inclination of the vector with positive direction of $x$-, $y$- and $z$-axis.

Actually I am needing this in my software project. so, it would be kind if u could provide me with a general formula or algorithm. Thank you.

share|cite|improve this question
If $v=(x,y,z)$ is the given vector, then the angles $\alpha $, $\beta $ and $\gamma $ between $v$ and, respectively, the positive $x$-, $y$- and $z$-axis verify the following equations $$\begin{equation*} \cos \alpha =\frac{x}{r},\quad \cos \beta =\frac{y}{r},\quad \cos \gamma =\frac{z}{r},\end{equation*}$$ where $r=\sqrt{x^{2}+y^{2}+z^{2}}$. You can then compute $\tan \alpha $, $\tan \beta $ and $\tan \gamma $. – Américo Tavares Mar 25 '12 at 15:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.