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$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1365717428 7733 (11 Apr 2013 21:57:08 GMT)
NNTP-Posting-Date: Thu, 11 Apr 2013 21:57:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3493072
Xref: comp.soft-sys.matlab:793322


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,