|
On 25 Jan., 14:51, "Toni " <annihilaa...@yahoo.com> wrote:
> Hello all,
>
> i have perhaps a silly question, which i would like to have some confirmation to, since i haven't been able to find any.
>
> So if i have an arbitrary vector, e.g v1 = [0.21 -0.8 0.56].
>
> Then if I'd like to know the angle this vector makes with the x,y and z axis,
> is it something like this:
>
> zang = acos(dot(v1,[0 0 1]'))*(180/pi);
> xang = acos(dot(v1,[1 0 0]'))*(180/pi);
> yang = acos(dot(v1,[0 1 0]'))*(180/pi);
>
> Huge thanks!
cos(theta) = (u*v)/(||u||*||v||)
If v1 from above is a unit vector, your formula from above is correct.
Best wishes
Torsten.
|