Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Angle between two Vectors
Date: Wed, 7 Nov 2012 20:07:09 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <k7ef1c$f4v$1@newscl01ah.mathworks.com>
References: <k7dnsn$c0o$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1352318829 15519 172.30.248.46 (7 Nov 2012 20:07:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 Nov 2012 20:07:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:782266

"Marcelo Costa" wrote in message <k7dnsn$c0o$1@newscl01ah.mathworks.com>...
> I have a Cartesian (X, Y, Z) with 3 points ABC, and they intersect at point B, would like to know how do I calculate the angle of intersection of these vectors? Sorry for my English. =]
- - - - - - - - - -
  Let A, B, and C each be a three-element vector containing the Cartesian coordinates for the three points.  The interior angle at B of triangle ABC is given by:

 a = atan2(norm(cross(A-B,C-B)),dot(A-B,C-B));

It will be an angle in radians somewhere between 0 and pi.

Roger Stafford