You have two vectors, one is a and the second b , now use:
Hi
A vector has x, y, and z components of Ax, Ay, and Az. I want to calculate the angle between the vector and the x-axis (call it theta).
I work out the following:
sqrt(Ax*Ax + Az*Az) * cos(theta) = Az
sqrt(Ax*Ax + Az*Az) * sin(theta) = Ax
So that theta = arctan(Ax/Az).
But the notes I have state a different equation for theta:
theta = arctan(Ax / sqrt(Az*Az + Ay*Ay))
Could you please tell me where I am going wrong, and how the notes get the answer?
Thanks.
Thanks. I didn't think about using that...but I'm still not getting it right.
To find the angle the vector makes with the x-axis, we can consider only the x and z components (Ax and Az).
Using the equation above: theta = arccos(Ax / sqrt(Ax*Ax + Az*Az))
Whereas in the notes it's Ay*Ay on denominator, rather than Ax*Ax...
Thanks. The notes I have give a solution using arctan instead of arccos. The answer given is: theta = arctan(Ax / sqrt(Az*Az + Ay*Ay))
The equation they give is on page 4: http://www.freescale.com/files/senso...ote/AN3461.pdf
How can I get from your solution to the one in the notes?
@earboth: Thanks for your diagram, it made it much clearer. I get the same result as you...
I guess the notes are wrong. One of my answers agrees with the notes, whilst for the other two (angles phi and rho), I get the inverse of the expression inside arctan.