Code: Select all
X1: 658, Y1: 1301, Z1: 1238 X2: 491, Y2: 222, Z2: 64045 X3: 65261, Y3: 67, Z3: 65459 heading1 = 1.10 heading2 = 0.42 heading3 = 0.00 radAngle = 0.42 actualAngle = 24.27
heading2 = atan2(y2, x2)
heading3 = atan2(y3, x3)
radAngle = heading2 - heading3
actualAnlgle = radAngle*(180/PI)
Am I getting incorrect heading data because of the large values? I googled it and someone else had said that "The outputs are 16-bit SIGNED integer (int)", so those large values are actually supposed to be negative numbers. Why is it outputting this data type rather than two's complement, and how do I fix this so that I can calculate the correct heading? Been struggling with this for a while now, any help would be great!