Path: news.mathworks.com!not-for-mail
From: "Natalie Sin Hwee " <sin.ng09@imperial.ac.uk>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Finding 3D Angle
Date: Fri, 13 Aug 2010 09:57:03 +0000 (UTC)
Organization: Imperial College
Lines: 20
Message-ID: <i434tf$c86$1@fred.mathworks.com>
References: <i3okop$9n9$1@fred.mathworks.com> <i3p1v7$cps$1@fred.mathworks.com> <i3rcor$lvh$1@fred.mathworks.com> <i3s4ak$ou$1@fred.mathworks.com> <i3u9la$rgu$1@fred.mathworks.com> <i3v542$g20$1@fred.mathworks.com> <i40t2s$f0u$1@fred.mathworks.com> <i413p4$6og$1@fred.mathworks.com>
Reply-To: "Natalie Sin Hwee " <sin.ng09@imperial.ac.uk>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1281693423 12550 172.30.248.37 (13 Aug 2010 09:57:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 13 Aug 2010 09:57:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2069448
Xref: news.mathworks.com comp.soft-sys.matlab:661688

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i413p4$6og$1@fred.mathworks.com>...
> "Natalie Sin Hwee " <sin.ng09@imperial.ac.uk> wrote in message <i40t2s$f0u$1@fred.mathworks.com>...
> > Dear Roger,
> > Thank you very much for your detailed help, i managed to interpret it into my code. Was wondering if i could obtain Theta from 0 to 2Pi (instead of -pi to +pi).
> > Thank you verymuch
> > 
> > Natalie
> - - - - - - - - - - -
>   If you want to retain the theta angles from 0 to pi as they are at present and add 2*pi to those that are negative, you can change the last line to:
> 
>  theta = mod(atan2(D(2),D(1)),2*pi);
> 
> Roger Stafford

Dear Roger,

Oh right! wow why didnt i think about that! Ure a star!! THANK YOU!!

Regards
Natalie