Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I just can't see what's wrong, this should be relatively simple...

I have a vector which has length 1. Then, I have two angles. The first ($\gamma$) is the angle between the projection of the vector in the $xz$ plane and the $z$ axis. The second ($\beta$) is the angle between the projection of the vector in the $yz$ plane and the $z$ axis.

All I need now are the (cartesian) vector components $(x,y,z)$.

How do I calculate them?

I got: $x = \sin(\gamma)\\ y = \sin(\beta)\\ z = \cos(\gamma) \cdot \cos(\beta)$

But this can't be correct, because the length of this vector is not always 1. Can you help me and find the error, please?

share|cite|improve this question
No, its no homework (not really). Context is: I get two angles from 4 solar panels (which means I compute those angles from the currents of the panels) – Daniel Jour Nov 21 '12 at 21:12
Suggested a homework tag -- looks like a homework problem. – gt6989b Nov 21 '12 at 21:12
but nonetheless the homework tag won't hurt ^^ – Daniel Jour Nov 21 '12 at 21:17
I suppose if you are planning to install the panels on your roof, then it is literally a home-work problem. – Gerry Myerson Nov 21 '12 at 23:16

1 Answer 1

up vote 4 down vote accepted

I think you got $x=\sin\gamma$ by saying that you have a right triangle in the $xz$-plane with side $x$ opposite angle $\gamma$, but then you are also assuming the length of the hypotenuse is $1$. It isn't. The hypotenuse is a projection of a vector of length $1$, but (unless the $y$-coordinate turns out to be zero) it is itself a vector of length strictly less than $1$.

Perhaps a more fruitful approach begins with $\tan\gamma=x/z$.

share|cite|improve this answer
Yes! I think this would lead much more quickly to the solution than the dot product approach I used in my answer. +1. – coffeemath Nov 22 '12 at 0:04
$x = z\tan\gamma$ and $y=z\tan\beta$ and $x^2+y^2+z^2=1$ so $z=\pm1/\sqrt{1+\tan^2\gamma+\tan^2\beta}$, huzzah! – Rahul Nov 22 '12 at 0:10
This is indeed much quicker, but I liked coffeemath's answer, too. And there is one more good about it: actually, I do have the tangens values of both angles. – Daniel Jour Nov 22 '12 at 8:41

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.