I looked at some solutions here but none provide what I need, so:
I need to average an array of angles(0 to 359.9, no negatives) (A1 + A2 + A3 + An) / n
The
Do you want to round it off i.e. 0 should come after 359 degree?
take a modulus of the result with 360.
avg = ( (a1 + a2 + an) /n ) % 360