/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{deg2rad as r}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as t,getMetersPerVerticalUnitForSR as o}from"../../core/units.js";import{h as s}from"../../chunks/vec32.js";import{getNormal as a,create as n,fromManyPoints as c}from"./plane.js";function i(t,o,s){const n=m(e,t,o,s)?a(e):[0,0,1];return Math.abs(n[2])>Math.cos(r(80))?2:Math.abs(n[1])>Math.abs(n[0])?1:0}function m(r,a,n,i){const m=(r=>!Array.isArray(r[0]))(a)?(r,t)=>a[3*r+t]:(r,t)=>a[r][t],e=i?t(i)/o(i):1;return c(r,(r,t)=>s(r,m(t,0)*e,m(t,1)*e,m(t,2)),n)}const e=n();export{m as fitPlane,i as leastSignificantAxis};
