Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!postnews.google.com!18g2000yqe.googlegroups.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: vector's angle to coordinate axes
Date: Wed, 25 Jan 2012 06:36:15 -0800 (PST)
Organization: http://groups.google.com
Lines: 25
Message-ID: <e77c167b-c772-401a-ad2b-0fae4f597a39@18g2000yqe.googlegroups.com>
References: <jfp1ce$kpr$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 192.102.151.35
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1327502257 5702 127.0.0.1 (25 Jan 2012 14:37:37 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 25 Jan 2012 14:37:37 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 18g2000yqe.googlegroups.com; posting-host=192.102.151.35; posting-account=X3eThQoAAACh5vOSip_rNRzKAq7k0jPW
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: ARLUEHNKC
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
 Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:755736

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.