From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: angles in a triangle
Date: Fri, 16 Mar 2012 17:15:17 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <jjvsf5$1ht$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1331918117 1597 (16 Mar 2012 17:15:17 GMT)
NNTP-Posting-Date: Fri, 16 Mar 2012 17:15:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3384503
Xref: comp.soft-sys.matlab:761236


I'm currently trying to write an algo to find the angles of a triangle.

I've tried both the acos method and the atan2 method Roger Stafford suggested in a thread before, but the one of the angles always turn out to be pi - theta and not the theta im looking for.

my vertices are 
a =

     1     5
     1     2
     2     4

and the angles i got (in degrees) ans =

   45.0000   26.5651  108.4349.

but when i plotted the graph, none of the angles were > 90 degrees.

is there a way around this?