/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{setAxisAngle as t,multiply as r}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as o}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as a,fromValues as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{toDegree as i,toRadian as c}from"../../core/libs/gl-matrix-2/math/common.js";import{copy as s,normalize as e,transformQuat as n}from"../../core/libs/gl-matrix-2/math/vec3.js";const f=a(),l=o(),p=o(),u=o(),x=m(0,0,1),b=m(0,1,0),g=m(1,0,0);function h(r){s(f,r),e(f,f);const a=Math.atan2(f[1],f[0]),m=t(o(),x,-a);n(f,f,m);const c=-1*Math.atan2(f[2],f[0]);return[i(a)+270,i(c)+90]}function j(o,a){return t(p,x,c(o-270)),t(u,b,c(a-90)),r(l,p,u),s(f,g),n(f,f,l),e(f,f),[f[0],f[1],f[2]]}export{j as computeNormalFromOrientationTilt,h as computeOrientationTiltFromNormal};
