Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Angle between two vectors
Date: Mon, 19 Jul 2010 12:38:04 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 37
Message-ID: <i21gvc$kls$1@fred.mathworks.com>
References: <ef5ce9c.-1@webcrossing.raydaftYaTP> <fjj9nj$fia$1@fred.mathworks.com> <fjk0tg$jli$1@fred.mathworks.com> <fl377q$4ip$1@fred.mathworks.com> <fl3moi$pvc$1@fred.mathworks.com> <i1su0s$deu$1@fred.mathworks.com> <i1t7en$gvq$1@fred.mathworks.com> <i1umi8$r2p$1@fred.mathworks.com> <i1v3gj$8rh$1@fred.mathworks.com> <i1vcn1$s7p$1@fred.mathworks.com> <i1vhmb$1rq$1@fred.mathworks.com> <i1vm13$ok8$1@fred.mathworks.com> <i21g0k$ker$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1279543084 21180 172.30.248.38 (19 Jul 2010 12:38:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 Jul 2010 12:38:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:654149

"Loren_Shure" <loren.shure@mathworks.com> wrote in message <i21g0k$ker$1@fred.mathworks.com>...
> 
> "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in 
> message news:i1vm13$ok8$1@fred.mathworks.com...
> > "Bard R." <this.is.not.a.real.address@gmail.com> wrote in message 
> > <i1vhmb$1rq$1@fred.mathworks.com>...
> >> This is exactly what I was looking for. And so much more compact than the 
> >> solution I had put together during the day. It works if A and B are 
> >> opposite (I had to do an extra check for that as well) and for my 
> >> application N is by definition never parallell to neither A nor B.
> >> Thanx a lot!
> >> B&#52293;rd
> > - - - - - - - - - - - -
> >  Well, if A and B, or even their projections, are in opposite directions, 
> > the outcome can suddenly flip from one extreme to the other depending on 
> > rounding.  A roundoff one way gets +pi as a result and in the other 
> > direction flips the answer over to -pi.  I don't see any good way out of 
> > that problem.  It is more or less inherent in the nature of numerical 
> > computation of angles.  A digital computer cannot even compute the exact 
> > value of pi itself.
> >
> > Roger Stafford
> 
> Have you checked out the function subspace: 
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/subspace.html ?
> 
> 
> -- 
> Loren
> http://blogs.mathworks.com/loren/
> http://matlabwiki.mathworks.com/MATLAB_FAQ 

dearest loren
if you carefully wade through this thread you'll find out that it has been discussed at length, already...

:-)
urs