Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating Vectors and Finding the angle
Date: Tue, 8 Nov 2011 09:12:12 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 8
Message-ID: <j9arpc$kvo$1@newscl01ah.mathworks.com>
References: <j98uv3$9f4$1@newscl01ah.mathworks.com> <j99k4g$pji$1@newscl01ah.mathworks.com> <j99ljd$1as$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1320743532 21496 172.30.248.47 (8 Nov 2011 09:12:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 8 Nov 2011 09:12:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:748630

"Roger Stafford" wrote in message <j99ljd$1as$1@newscl01ah.mathworks.com>...
>  a = atan2(abs(cross(vw-ve,vs-ve)),dot(vw-ve,vs-ve));
- - - - - - - - -
  My apologies.  I made another error.  I was thinking of the two-dimensional case.  The answer should have been:

 a = atan2(norm(cross(vw-ve,vs-ve)),dot(vw-ve,vs-ve));

Roger Stafford