Circular Mean Implementation Example

Hi there,

This workflow provides a practical implementation of the circular mean algorithm, as detailed in the linked Wikipedia article. Using the article’s example angles of 355°, 5°, and 15°, it demonstrates the correct method for averaging cyclical data. The process involves converting the angles into their vector components (sine and cosine), calculating the average of these components, and then converting the result back into a final mean angle using the atan2 function. This method correctly yields 5°, avoiding the erroneous 125° result produced by a simple arithmetic mean. The same logic can be scaled up using the GroupBy node, making this implementation ideal for accurately averaging real-world cyclical data like wind direction.

Wikipedia article: Circular mean - Wikipedia

Cheers,

Carlos