Averages/Mean angle: Difference between revisions

m
Line 985:
=={{header|Julia}}==
Julia has built-in functions <code>sind</code> and <code>cosd</code> to compute the sine and cosine of angles specified in degrees accurately (avoiding the roundoff errors incurred in conversion to radians), and a built-in function to convert radians to degrees (or vice versa). Using these:
<lang julia>using Statistics
<lang julia>meandegrees(degrees) = radians2degrees(atan2(mean(sind(degrees)), mean(cosd(degrees))))</lang>
The output is:
<lang julia>julia> meandegrees([350, 10])
4,105

edits