/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{getEpsilon as o}from"../../../../core/libs/gl-matrix-2/math/common.js";function n(o){const n=r(o);return t(Math.cos(n),Math.sin(n))}function r(t){if(null==t||"polyline"!==t.type&&"polygon"!==t.type)return 0;const n="polyline"===t.type?t.paths:t.rings,r=o();for(const o of n)for(let t=0;t<o.length-1;t++){const n=o[t],e=o[t+1],i=n[0]-e[0],l=n[1]-e[1];if(i*i+l*l>r)return Math.atan2(e[1]-n[1],e[0]-n[0])}return 0}export{n as mainAxis,r as orientation};
