Icon

Forum0010 - Circular Mean Example

<p><strong>Circular Mean Implementation Example</strong></p><p>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&nbsp;atan2&nbsp;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&nbsp;GroupBy&nbsp;node, making this implementation ideal for accurately averaging real-world cyclical data like wind direction.</p><p></p><p>Wikipedia article: https://en.wikipedia.org/wiki/Circular_mean</p>

Circular Mean Implementation Example

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: https://en.wikipedia.org/wiki/Circular_mean

atan2 calculationconversion to degrees
Expression
degreesto radians
Expression
sin and coscalculation
Expression
data example
Table Creator
sin and cosfiltering
Column Filter
circular meanrenaming
Column Renamer
Incorrect wayto calculatethe mean
GroupBy
sin and cosmeansyou can use thisnode to aggregate data
GroupBy
normalizationto range 0 to 360
Expression

Nodes

Extensions

Links