Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Angle between two vectors
Date: Thu, 10 Mar 2011 13:38:05 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 30
Message-ID: <ilak7t$gme$1@fred.mathworks.com>
References: <ef5ce9c.-1@webcrossing.raydaftYaTP> <1184052626.324470.175540@n2g2000hse.googlegroups.com> <ellieandrogerxyzzy-1007070127090001@dialup-4.232.57.130.dial1.losangeles1.level3.net> <1184104526.774530.54800@n60g2000hse.googlegroups.com> <ellieandrogerxyzzy-1007071622370001@dialup-4.232.15.192.dial1.losangeles1.level3.net> <idlqpm$rc7$1@fred.mathworks.com> <il9t55$en6$1@fred.mathworks.com> <ilafo2$nnp$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1299764285 17102 172.30.248.37 (10 Mar 2011 13:38:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 10 Mar 2011 13:38:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:715015

"Loren Shure" <loren.shure@mathworks.com> wrote in message <ilafo2$nnp$1@fred.mathworks.com>...
> 
> "Marwan N" <munna860@gmail.com> wrote in message 
> news:il9t55$en6$1@fred.mathworks.com...
> > hey guys,
> >
> > I went thro the codes u all gave several times....all are different ways 
> > for the same pupose....which finally gave me a head spin after all those 
> > cods in my head. As a simple conclusion can someone answer me the 
> > following:
> >
> > 1. how do we calculate the angle (consider both the obtuse and acute 
> > angle) between two vectors (consider that they intersect at origin or in 
> > other words, they originate from origin)
> >
> > 2.the vectors start at the origin and terminate at the points 
> > X=[coresponding coeff of i j k] and Y=[corresponding coeff of i j k]
> >
> > 3.the results (obtuse and acute angle) should lie between 0 and pi.
> >
> > any bright ideas anyone??
> >
> 
> Will the subspace function do what you want? 
> http://www.mathworks.com/help/techdoc/ref/subspace.html
> 

subspace() will always reduce the resultant angle between [0,pi/2]. I'm not sure this is appropriate for geometry computation.

Bruno