From: "salih tuna" <>
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$>
References: <ef5ce9c.-1@webcrossing.raydaftYaTP>
Reply-To: "salih tuna" <>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1197287987 15946 (10 Dec 2007 11:59:47 GMT)
NNTP-Posting-Date: Mon, 10 Dec 2007 11:59:47 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1061324
Xref: comp.soft-sys.matlab:441754

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

"y Mehta" <mehtayogesh@gmail.(DOT).com> wrote in message
> 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