import{checkArg as t}from"./checkArg.js";import{length as r,map as e,reduce as n}from"./iterable.js";export function sum(r){return t("values",r).isNotMissing(),n(r,((t,r)=>t+r),0)}export function average(e){t("values",e).isNotMissing();const n=r(e);return n?sum(e)/n:NaN}export function standardDeviation(r){t("values",r).isNotMissing();const n=average(r);if(isNaN(n))return NaN;const s=e(r,(t=>{const r=t-n;return r*r}));return Math.sqrt(average(s))}export function degreesToRadians(t){return t%360*(Math.PI/180)}export function radiansToDegrees(t){return t%(2*Math.PI)*(180/Math.PI)}