define(["exports","./Matrix2-ccd5b911","./RuntimeError-346a3079","./when-4bbc8319","./ComponentDatatype-93750d1a"],function(t,M,i,c,m){"use strict";function l(t,i,a){if(0===t)return i*a;var e=t*t,n=e*e,s=n*e,h=s*e,u=h*e,t=u*e,a=a;return i*((1-e/4-3*n/64-5*s/256-175*h/16384-441*u/65536-4851*t/1048576)*a-(3*e/8+3*n/32+45*s/1024+105*h/4096+2205*u/131072+6237*t/524288)*Math.sin(2*a)+(15*n/256+45*s/1024+525*h/16384+1575*u/65536+155925*t/8388608)*Math.sin(4*a)-(35*s/3072+175*h/12288+3675*u/262144+13475*t/1048576)*Math.sin(6*a)+(315*h/131072+2205*u/524288+43659*t/8388608)*Math.sin(8*a)-(693*u/1310720+6237*t/5242880)*Math.sin(10*a)+1001*t/8388608*Math.sin(12*a))}function d(t,i){if(0===t)return Math.log(Math.tan(.5*(m.CesiumMath.PI_OVER_TWO+i)));var a=t*Math.sin(i);return Math.log(Math.tan(.5*(m.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+a)/(1-a))}var r=new M.Cartesian3,g=new M.Cartesian3;function e(t,i,a,e){M.Cartesian3.normalize(e.cartographicToCartesian(i,g),r),M.Cartesian3.normalize(e.cartographicToCartesian(a,g),g);var n,s,h=e.maximumRadius,u=e.minimumRadius,o=h*h;t._ellipticitySquared=(o-u*u)/o,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=M.Cartographic.clone(i,t._start),t._start.height=0,t._end=M.Cartographic.clone(a,t._end),t._end.height=0,t._heading=(n=t,s=i.longitude,h=i.latitude,u=a.longitude,o=a.latitude,h=d(n._ellipticity,h),o=d(n._ellipticity,o),Math.atan2(m.CesiumMath.negativePiToPi(u-s),o-h)),t._distance=(u=t,s=e.maximumRadius,o=e.minimumRadius,h=i.longitude,t=i.latitude,e=a.longitude,i=a.latitude,a=u._heading,e-=h,h=0,h=m.CesiumMath.equalsEpsilon(Math.abs(a),m.CesiumMath.PI_OVER_TWO,m.CesiumMath.EPSILON8)?s===o?s*Math.cos(t)*m.CesiumMath.negativePiToPi(e):(o=Math.sin(t),s*Math.cos(t)*m.CesiumMath.negativePiToPi(e)/Math.sqrt(1-u._ellipticitySquared*o*o)):(t=l(u._ellipticity,s,t),(l(u._ellipticity,s,i)-t)/Math.cos(a)),Math.abs(h))}function o(t,i,a,e,n,s){if(0===a)return M.Cartographic.clone(t,s);var h,u,o,r=n*n;return o=Math.abs(m.CesiumMath.PI_OVER_TWO-Math.abs(i))>m.CesiumMath.EPSILON8?(h=function(t,i,a){var e=t/a;if(0===i)return e;var n=e*e,s=n*e,h=s*e,u=i*i,o=u*u,r=o*u,l=r*u,d=l*u,M=d*u,c=Math.sin(2*e),m=Math.cos(2*e),g=Math.sin(4*e),_=Math.cos(4*e),p=Math.sin(6*e),C=Math.cos(6*e),t=Math.sin(8*e),a=Math.cos(8*e),i=Math.sin(10*e);return e+e*u/4+7*e*o/64+15*e*r/256+579*e*l/16384+1515*e*d/65536+16837*e*M/1048576+(3*e*o/16+45*e*r/256-e*(32*n-561)*l/4096-e*(232*n-1677)*d/16384+e*(399985-90560*n+512*h)*M/5242880)*m+(21*e*r/256+483*e*l/4096-e*(224*n-1969)*d/16384-e*(33152*n-112599)*M/1048576)*_+(151*e*l/4096+4681*e*d/65536+1479*e*M/16384-453*s*M/32768)*C+(1097*e*d/65536+42783*e*M/1048576)*a+8011*e*M/1048576*Math.cos(10*e)+(3*u/8+3*o/16+213*r/2048-3*n*r/64+255*l/4096-33*n*l/512+20861*d/524288-33*n*d/512+h*d/1024+28273*M/1048576-471*n*M/8192+9*h*M/4096)*c+(21*o/256+21*r/256+533*l/8192-21*n*l/512+197*d/4096-315*n*d/4096+584039*M/16777216-12517*n*M/131072+7*h*M/2048)*g+(151*r/6144+151*l/4096+5019*d/131072-453*n*d/16384+26965*M/786432-8607*n*M/131072)*p+(1097*l/131072+1097*d/65536+225797*M/10485760-1097*n*M/65536)*t+(8011*d/2621440+8011*M/1048576)*i+293393*M/251658240*Math.sin(12*e)}(l(n,e,t.latitude)+a*Math.cos(i),n,e),o=d(n,t.latitude),u=d(n,h),o=Math.tan(i)*(u-o),m.CesiumMath.negativePiToPi(t.longitude+o)):(h=t.latitude,o=a/(0===n?e*Math.cos(t.latitude):(n=Math.sin(t.latitude),e*Math.cos(t.latitude)/Math.sqrt(1-r*n*n))),0