From: us on
"Loren_Shure" <loren.shure(a)mathworks.com> wrote in message <i21g0k$ker$1(a)fred.mathworks.com>...
>
> "Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in
> message news:i1vm13$ok8$1(a)fred.mathworks.com...
> > "Bard R." <this.is.not.a.real.address(a)gmail.com> wrote in message
> > <i1vhmb$1rq$1(a)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
From: Roger Stafford on
"Loren_Shure" <loren.shure(a)mathworks.com> wrote in message <i21g0k$ker$1(a)fred.mathworks.com>...
> 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
- - - - - - - - -
Yes, Loren, as Urs has said, that was discussed in article #46 of this overly-long thread. The person proposing to use subspace was seeking an angle that ranges from 0 to pi (180 deg) as in the inner angle in triangles, but subspace would not give an angle beyond pi/2 in this case. For example

a = subspace([1;0],[-1;1]) ---> 1/4*pi

whereas

a = acos([1;0],[-1;1]) --> 3/4*pi

This reminds me. As I pointed out in that #46 article, Mathworks' documents are still in error in claiming about subspace "If A and B are column vectors of unit length, this is the same as acos(A'*B)." This error was present in my manual for system 4a back in 1994 and it still persists to this day in their most recent documentation. It should read acos(abs(A'*B)). Have you any influence with the documentation department to get them to finally make a correction on this misleading statement?

Roger Stafford
From: Loren Shure on

"Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in
message news:i221e8$3du$1(a)fred.mathworks.com...
> "Loren_Shure" <loren.shure(a)mathworks.com> wrote in message
> <i21g0k$ker$1(a)fred.mathworks.com>...
>> 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
> - - - - - - - - -
> Yes, Loren, as Urs has said, that was discussed in article #46 of this
> overly-long thread. The person proposing to use subspace was seeking an
> angle that ranges from 0 to pi (180 deg) as in the inner angle in
> triangles, but subspace would not give an angle beyond pi/2 in this case.
> For example
>
> a = subspace([1;0],[-1;1]) ---> 1/4*pi
>
> whereas
>
> a = acos([1;0],[-1;1]) --> 3/4*pi
>
> This reminds me. As I pointed out in that #46 article, Mathworks'
> documents are still in error in claiming about subspace "If A and B are
> column vectors of unit length, this is the same as acos(A'*B)." This
> error was present in my manual for system 4a back in 1994 and it still
> persists to this day in their most recent documentation. It should read
> acos(abs(A'*B)). Have you any influence with the documentation department
> to get them to finally make a correction on this misleading statement?
>
> Roger Stafford
>

Roger-

Will enter a request to update the doc...

--
Loren
http://blogs.mathworks.com/loren/
http://matlabwiki.mathworks.com/MATLAB_FAQ