/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{transpose as t,multiply as r,adjoint as s,set as i}from"./libs/gl-matrix-2/math/mat3.js";import{create as m}from"./libs/gl-matrix-2/factories/mat3f64.js";import{set as o}from"./libs/gl-matrix-2/math/vec2.js";import{h as a,t as e}from"../chunks/vec32.js";import{create as c}from"./libs/gl-matrix-2/factories/vec3f64.js";const f=c(),n=m(),l=m(),u=m();function p(r,s,i){return a(f,s[0],s[1],1),e(f,f,t(n,i)),0===f[2]?o(r,f[0],f[1]):o(r,f[0]/f[2],f[1]/f[2])}function j(t,i,m){return x(l,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]),x(u,m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7]),r(t,s(l,l),u),0!==t[8]&&(t[0]/=t[8],t[1]/=t[8],t[2]/=t[8],t[3]/=t[8],t[4]/=t[8],t[5]/=t[8],t[6]/=t[8],t[7]/=t[8],t[8]/=t[8]),t}function x(m,o,c,l,u,p,j,x,b){i(m,o,l,p,c,u,j,1,1,1),a(f,x,b,1),s(n,m);const[g,h,v]=e(f,f,t(n,n));return i(n,g,0,0,0,h,0,0,0,v),r(m,n,m)}export{j as getProjectiveTransform,p as transformProjective};
