/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../core/screenUtils","../../../chunks/vec2","../../../chunks/vec3","../../../chunks/vec3f64","../../../geometry/Point","../../../support/elevationInfoUtils"],(function(e,r,n,t,o,c,a){"use strict";function i(e,r,t,o){t.projectToRenderScreen(e,S),t.projectToRenderScreen(r,C),n.subtract(o,C,S),n.normalize(o,o)}function s(e,r,n){return Math.sqrt(d(e,r,n))}function d(e,r,t){const{camera:o}=t.state;return o.projectToScreen(e,P),o.projectToScreen(r,T),n.squaredDistance(P,T)}function l(e,r,n,t,c=o.create()){const i=r.toXYZ(e);return i[2]=a.getConvertedElevationFromVector(t,i,r.spatialReference,n)||0,t.renderCoordsHelper.toRenderCoords(i,r.spatialReference,c),c}function u(e,r,n,c,i=o.create()){const s=t.copy(v,e);return s[2]=a.getConvertedElevationFromVector(c,s,r,n)||0,c.renderCoordsHelper.toRenderCoords(s,r,i),i}function p(e,n,t,o){return"2d"===o.type?o.toScreen(n.vectorToPoint(e,R)):(l(e,n,t,o,v),o.state.camera.projectToScreen(v,P),r.createScreenPoint(P[0],P[1]))}function f(e,r,n,t,o,c,i){const s=n.toXYZ(e),d=n.toXYZ(r);if("absolute-height"!==t.mode){const e=a.getConvertedElevationFromVector(o,s,n.spatialReference,t),r=a.getConvertedElevationFromVector(o,d,n.spatialReference,t),c=(null==e?r:null==r?e:Math.min(e,r))||0;s[2]=c,d[2]=c}o.renderCoordsHelper.toRenderCoords(s,n.spatialReference,c),o.renderCoordsHelper.toRenderCoords(d,n.spatialReference,i)}const R=new c,v=o.create(),S=r.createRenderScreenPointArray3(),C=r.createRenderScreenPointArray3(),P=r.createScreenPointArray(),T=r.createScreenPointArray();e.anyMapPointToRender=l,e.anyMapPointToScreenPoint=p,e.anyMapPointsToRenderWithEqualRelativeZ=f,e.renderScreenSpaceTangent=i,e.screenDistance=s,e.screenDistanceSquared=d,e.vectorToRender=u,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
