A simple solution is to convert these angles into a set of vectors, from polar coordinates to Cartesian coordinates.
Since you work with colors, think of it as converting to a plane (a *, b *). Then take the average of these coordinates, and then return to the polar form again. Done in Matlab,
theta = [355,5,5,5,5]; x = cosd(theta); % cosine in terms of degrees y = sind(theta); % sine with a degree argument
Now take the average of x and y, calculate the angle, then convert back from radians to degrees.
meanangle = atan2(mean(y),mean(x))*180/pi meanangle = 3.0049
Of course, this solution is valid only for the average angle. As you can see, it gives a consistent result with the average angles directly, where I understand that 355 degrees really wrap up to -5 degrees.
mean([-5 5 5 5 5]) ans = 3
To calculate the standard deviation, the easiest way to do this is to
std([-5 5 5 5 5]) ans = 4.4721
Yes, this requires me to do the transfer explicitly.
user85109
source share