/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{P as t}from"../../../chunks/Point2D.js";import{T as r}from"../../../chunks/Transformation2D.js";import{deg2rad as s}from"../../../core/mathUtils.js";const n={uniform:0,conformal:1,rigid:2,"rigid-motion":3,general:4},o=r=>r.map(r=>new t(r.x,r.y));class i{constructor(){this.transform=new r}calculateErrors(t,r){const s=t.length,n=r.length;if(s!==n)throw new Error(`The input length (${s}) is not the same as output length (${n})`);const i=[];return{rms:this.transform.calculateErrors(s,o(t),o(r),i),errorsOut:i}}flipX(t,r){return this.transform.flipX(t,r),this}flipY(t,r){return this.transform.flipY(t,r),this}initializeFromControlPoints(t,r,s,i){const e=r.length,a=s.length;if(e!==a)throw new Error(`The input length (${e}) is not the same as output length (${a})`);this.transform.initializeFromControlPoints(n[t],e,o(r),o(s),i?.transform)}isIdentity(){return this.transform.isIdentity()}rotate(r,n,o){const i=s(r);return null!=n&&null!=o?this.transform.rotateAngleAbout(i,new t(n,o)):this.transform.rotateAngle(i),this}scale(t,r){return this.transform.scale(t,r),this}setIdentity(){this.transform.setIdentity()}setSwapCoordinates(){return this.transform.setSwapCoordinates(),this}shear(t,r){return this.transform.shear(t,r),this}shift(t,r){return this.transform.shiftCoords(t,r),this}}export{i as default};
