/*
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/mathUtils","../../../geometry/Point","../../../geometry/projectionEllipsoid"],(function(e,t,n,o){"use strict";function r(e,t,n){return i(e,t.longitude,t.latitude,n.longitude,n.latitude)}function i(e,n,o,r,i){const a=t.deg2rad(o),s=t.deg2rad(i),u=a-s,d=t.deg2rad(n)-t.deg2rad(r),c=Math.sin(u/2),l=Math.sin(d/2),g=2*t.asinClamped(Math.sqrt(c*c+Math.cos(a)*Math.cos(s)*l*l))*e;return Math.round(1e4*g)/1e4}function a(e,t,i){const a=t.spatialReference,s=o.getReferenceEllipsoid(a),u=new n(t.x,e.y,a),d=new n(i.x,e.y,a),c=new n(e.x,t.y,a),l=new n(e.x,i.y,a);return{lon:r(s.radius,u,d),lat:r(s.radius,c,l)}}function s(e,n,o){const r=n/o,i=t.deg2rad(e),a=Math.sin(r/2),s=Math.cos(i),u=2*t.asinClamped(Math.sqrt(a*a/(s*s)));return t.rad2deg(u)}function u(e,n){return t.rad2deg(e/n)}function d(e,n){const o=e/2,r=t.deg2rad(o);return(1-Math.sin(r))*n/Math.sin(r)}function c(e,t){let n=e/15;return t||(n=Math.round(n)),n}function l(e,t){return c(e.longitude,t)}function g(e,t){t||(t={hours:0,minutes:0,seconds:0}),t.hours=c(e[0],!0);const n=t.hours%1;t.hours-=n,t.minutes=60*n;const o=t.minutes%1;return t.minutes-=o,t.seconds=Math.round(60*o),t}e.getGreatCircleDistance=i,e.getGreatCircleDistanceFromPoints=r,e.getGreatCircleSpanAt=a,e.getLatDeltaForDistance=u,e.getLonDeltaForDistance=s,e.getMaxCameraAltitude=d,e.longitudeToTimezone=c,e.pointToTimezone=l,e.positionToTimezoneInfo=g,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
