Alice
Posts:
2
Registered:
11/13/13


atan2 (360 to 360) Joint angle calculations.
Posted:
Nov 13, 2013 6:03 AM


I am trying to calculate 2D joint angles using basic trig.
A1=[x1, y1]; B1=[x2,y2];
% Determining the coordinates of the 3rd point (to create a triangle) C1 = [x1,y2];
% Trigonometry Calculations Opp1= C1B1; Adj1=A1C1; pheta1= atan2(Opp1(:,1),Adj1(:,2));
% convert degrees pheta1= pheta1*(180/pi);
However, after using the formula above I am finding, where participants extend their shoulder >180, it flips round to a minus value. I understand this to be due to my use of atan2.
However I am unable to use a simple if pheta1< 0, pheta1=pheta1+360, end. Because there are some values <0 that are correct/true, and not the result of flipping.
I have tried; * pheta1=mod(360+pheta1,360); * pheta1=rem(360+pheta1,360); and various versions of unwrap, currently with no luck.
If anyone has any suggestions, they would be very welcomed.
Thanks in advance! Alice

