define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./Transforms-79117a7b","./OrientedBoundingBox-eb360dc3"],function(n,d,t,l,f){"use strict";var e={},i=new d.Cartesian3,x=new d.Cartesian3,B=new d.Cartesian3,P=new d.Cartesian3,M=new f.OrientedBoundingBox;function o(n,t,e,r,a){t=d.Cartesian3.subtract(n,t,i),e=d.Cartesian3.dot(e,t),t=d.Cartesian3.dot(r,t);return d.Cartesian2.fromElements(e,t,a)}e.validOutline=function(n){var t=f.OrientedBoundingBox.fromPoints(n,M).halfAxes,e=l.Matrix3.getColumn(t,0,x),n=l.Matrix3.getColumn(t,1,B),t=l.Matrix3.getColumn(t,2,P),e=d.Cartesian3.magnitude(e),n=d.Cartesian3.magnitude(n),t=d.Cartesian3.magnitude(t);return!(0===e&&(0===n||0===t)||0===n&&0===t)},e.computeProjectTo2DArguments=function(n,t,e,r){var a,i,o=f.OrientedBoundingBox.fromPoints(n,M),u=o.halfAxes,s=l.Matrix3.getColumn(u,0,x),C=l.Matrix3.getColumn(u,1,B),c=l.Matrix3.getColumn(u,2,P),m=d.Cartesian3.magnitude(s),g=d.Cartesian3.magnitude(C),n=d.Cartesian3.magnitude(c),u=Math.min(m,g,n);return(0!==m||0!==g&&0!==n)&&(0!==g||0!==n)&&(u!==g&&u!==n||(a=s),u===m?a=C:u===n&&(i=C),u!==m&&u!==g||(i=c),d.Cartesian3.normalize(a,e),d.Cartesian3.normalize(i,r),d.Cartesian3.clone(o.center,t),!0)},e.createProjectPointsTo2DFunction=function(r,a,i){return function(n){for(var t=new Array(n.length),e=0;e<n.length;e++)t[e]=o(n[e],r,a,i);return t}},e.createProjectPointTo2DFunction=function(e,r,a){return function(n,t){return o(n,e,r,a,t)}},n.CoplanarPolygonGeometryLibrary=e});
