Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: atan2 angles
Date: Thu, 11 Apr 2013 21:57:08 +0000 (UTC)
Organization: University of Oxford
Lines: 20
Message-ID: <kk7bjk$7hl$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1365717428 7733 172.30.248.35 (11 Apr 2013 21:57:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 11 Apr 2013 21:57:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3493072
Xref: news.mathworks.com comp.soft-sys.matlab:793322

Hello,

It's a bit embarrassing asking this owing to the simplicity but I am trying to do this:

given a vector from (0,0) to a point on a y-x axis (y pointing North, and x pointing to the East)...

calculate the angle between the positive Y axis and the vector.
1) I would like that if the vector lies on the positive Y i get 0 degrees. 
2) The angle should increase as it goes ANTICLOCKWISE 
3) I can only have values from 0-360 degrees. 

Is it possible to avoid using IF loops and whatnot?

I think you need to use atan2...?

Please help.

Kind Regards,

F