You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python code to calculate true average aspect (arctan2(sum(cos), sum(sin))
importmath# 9 cells, 3 facing NNW, the others NNE # average should be roughly northaspects_deg= [357,357,358,45,21,13,55,28,24]
aspects_deg= [float(x) forxinaspects_deg]
printsum(aspects_deg)/9.0# mean aspect of 139.7 (SE) is DEFINITELY NOT RIGHT# convert to radians aspects_rad= [math.radians(x) forxinaspects_deg]
cos= [math.sin(x) forxinaspects_rad]
sin= [math.cos(x) forxinaspects_rad]
avg_aspect_rad=math.atan2(sum(cos), sum(sin))
avg_aspect_deg=math.degrees(avg_aspect_rad)
printavg_aspect_deg#avg_aspect_deg == 19.625 .. CORRECT!