define(["exports","./Check-52a7d806","./when-92c6cf3c","./Math-92c3b5f7"],(function(e,t,n,r){"use strict";function o(e,t,r){this.x=n.u(e,0),this.y=n.u(t,0),this.z=n.u(r,0)}o.fromSpherical=function(e,r){t.o.typeOf.object("spherical",e),n.e(r)||(r=new o);var a=e.clock,i=e.cone,u=n.u(e.magnitude,1),f=u*Math.sin(i);return r.x=f*Math.cos(a),r.y=f*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n.e(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n.e(e))return n.e(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,o){return t.o.typeOf.object("value",e),t.o.defined("array",r),o=n.u(o,0),r[o++]=e.x,r[o++]=e.y,r[o]=e.z,r},o.unpack=function(e,r,a){return t.o.defined("array",e),r=n.u(r,0),n.e(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,r){t.o.defined("array",e);var a=e.length;n.e(r)?r.length=3*a:r=new Array(3*a);for(var i=0;ir.e.EPSILON12);return n.e(f)?(f.x=c*S,f.y=l*E,f.z=s*N,f):new o(c*S,l*E,s*N)}function b(e,t,r){this.longitude=n.u(e,0),this.latitude=n.u(t,0),this.height=n.u(r,0)}b.fromRadians=function(e,r,o,a){return t.o.typeOf.number("longitude",e),t.o.typeOf.number("latitude",r),o=n.u(o,0),n.e(a)?(a.longitude=e,a.latitude=r,a.height=o,a):new b(e,r,o)},b.fromDegrees=function(e,n,o,a){return t.o.typeOf.number("longitude",e),t.o.typeOf.number("latitude",n),e=r.e.toRadians(e),n=r.e.toRadians(n),b.fromRadians(e,n,o,a)};var g=new o,O=new o,z=new o,x=new o(1/6378137,1/6378137,1/6356752.314245179),w=new o(1/6378137,1/6378137,1/6378137),j=new o(1/40680631590769,1/40680631590769,1/40408299984661.445),v=new o(1/40680631590769,1/40680631590769,1/40680631590769),q=r.e.EPSILON1;b.fromCartesian=function(e,t,a){var i=n.e(t)?t.oneOverRadii:w,u=n.e(t)?t.oneOverRadiiSquared:v,f=n.e(t)?t._centerToleranceSquared:q;r.e.equalsEpsilon(r.e.Radius,6356752.314245179,r.e.EPSILON10)&&(i=n.e(t)?t.oneOverRadii:x,u=n.e(t)?t.oneOverRadiiSquared:j);var c=m(e,i,u,f,O);if(n.e(c)){var l=o.multiplyComponents(c,u,g);l=o.normalize(l,l);var s=o.subtract(e,c,z),y=Math.atan2(l.y,l.x),d=Math.asin(l.z),h=r.e.sign(o.dot(s,e))*o.magnitude(s);return n.e(a)?(a.longitude=y,a.latitude=d,a.height=h,a):new b(y,d,h)}},b.toCartesian=function(e,n,r){return t.o.defined("cartographic",e),o.fromRadians(e.longitude,e.latitude,e.height,n,r)},b.sphericalDistance=function(e,n,o,a){if(t.o.defined("longitudeA",e),t.o.defined("longitudeB",o),t.o.defined("latitudeA",n),t.o.defined("latitudeB",a),e===o&&n===a)return 0;var i=r.e.toRadians(n),u=r.e.toRadians(a),f=r.e.toRadians(e),c=r.e.toRadians(o),l=f*f+i*i,s=c*c+u*u,y=(l+s-((f-c)*(f-c)+(i-u)*(i-u)))/(2*Math.sqrt(l)*Math.sqrt(s));return y=r.e.clamp(y,-1,1),Math.acos(y)*r.e.Radius},b.clone=function(e,t){if(n.e(e))return n.e(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new b(e.longitude,e.latitude,e.height)},b.equals=function(e,t){return e===t||n.e(e)&&n.e(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},b.equalsEpsilon=function(e,r,o){return t.o.typeOf.number("epsilon",o),e===r||n.e(e)&&n.e(r)&&Math.abs(e.longitude-r.longitude)<=o&&Math.abs(e.latitude-r.latitude)<=o&&Math.abs(e.height-r.height)<=o},b.ZERO=Object.freeze(new b(0,0,0)),b.prototype.clone=function(e){return b.clone(this,e)},b.prototype.equals=function(e){return b.equals(this,e)},b.prototype.equalsEpsilon=function(e,t){return b.equalsEpsilon(this,e,t)},b.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},e.P=m,e.t=o,e.t$1=b}));