Path: news.mathworks.com!not-for-mail
From: "salih tuna" <salihtuna@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Angle between two vectors
Date: Mon, 10 Dec 2007 11:59:47 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <fjj9nj$fia$1@fred.mathworks.com>
References: <ef5ce9c.-1@webcrossing.raydaftYaTP>
Reply-To: "salih tuna" <salihtuna@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1197287987 15946 172.30.248.35 (10 Dec 2007 11:59:47 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 10 Dec 2007 11:59:47 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1061324
Xref: news.mathworks.com comp.soft-sys.matlab:441754


hello,
how can i calculate the angles so that they are in the range
0-360 degrees?
thanks
salih


"y Mehta" <mehtayogesh@gmail.(DOT).com> wrote in message
<ef5ce9c.-1@webcrossing.raydaftYaTP>...
> How do I find the angle between two unit vectors a and b?
I know I
> can find cosine theta by the following formula:
> 
> theta = acos(dot(a,b));
> 
> However, how do I know whether the angle is actually
theta, or -theta
> or pi-theta or pi+theta??
> 
> Notice that the vectors are in three dimension (3d).
> 
> Thanks,
> -YM