Path: news.mathworks.com!not-for-mail
From: "Toni " <annihilaatio@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: vector's angle to coordinate axes
Date: Wed, 25 Jan 2012 13:51:10 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <jfp1ce$kpr$1@newscl01ah.mathworks.com>
Reply-To: "Toni " <annihilaatio@yahoo.com>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1327499470 21307 172.30.248.35 (25 Jan 2012 13:51:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Jan 2012 13:51:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1720933
Xref: news.mathworks.com comp.soft-sys.matlab:755726


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!