text: Example A simple way to calculate the mean of a series of angles (in the interval [0°, 360°)) is to calculate the mean of the cosines and sines of each angle, and obtain the angle by calculating the inverse tangent. Consider the following three angles as an example: 10, 20, and 30 degrees. Intuitively, calculating the mean would involve adding these three angles together and dividing by 3, in this case indeed resulting in a correct mean angle of 20 degrees. By rotating this system anticlockwise through 15 degrees the three angles become 355 degrees, 5 degrees and 15 degrees. The arithmetic mean is now 125 degrees, which is the wrong answer, as it should be 5 degrees. The vector mean  can be calculated in the following way, using the mean sine  and the mean cosine :
  Implementation
  In this python code we use day hours to find circular average of them:
  import math
  def circular_mean(hours):
  # Convert hours to radians
  # To convert from hours to degrees, we need to
  # multiply hour by 360/24 = 15.
  radians = [math.radians(hour * 15) for hour in hours]
  # Calculate the sum of sin and cos values
  sin_sum = sum([math.sin(rad) for rad in radians])
  cos_sum = sum([math.cos(rad) for rad in radians])
  # Calculate the circular mean using arctan2
  mean_rad = math.atan2(sin_sum, cos_sum)
  # Convert the mean back to hours
  mean_hour = (math.degrees(mean_rad) / 15) % 24
  return mean_hour
  # Example usage:
  hours = [0, 12, 18]
  mean_hour = circular_mean(hours)
  print("First Circular mean:", round(mean_hour, 2))
  hours = [0, 12]
  mean_hour = circular_mean(hours)
  print("Second Circular mean:", round(mean_hour, 2))
  hours = [0, 0, 12, 12, 24]
  mean_hour = circular_mean(hours)
  print("Third Circular mean:", round(mean_hour, 2))
  Generalizations
  Spherical mean
  Weighted spherical mean
  A weighted spherical mean can be defined based on spherical linear interpolation.