/* 2020-9-22 15:23:25 | 版权所有 军懋国兴  */
define(["exports","./Check-35e1a91d","./Cartesian2-43e3a3be","./Transforms-2d1ac5ec","./OrientedBoundingBox-5e0b7a7c"],function(e,g,x,h,B){"use strict";var n={},s=new x.Cartesian3,P=new x.Cartesian3,p=new x.Cartesian3,M=new x.Cartesian3,k=new B.OrientedBoundingBox;function o(e,n,t,a,r){var i=x.Cartesian3.subtract(e,n,s),o=x.Cartesian3.dot(t,i),u=x.Cartesian3.dot(a,i);return x.Cartesian2.fromElements(o,u,r)}n.validOutline=function(e){g.Check.defined("positions",e);var n=B.OrientedBoundingBox.fromPoints(e,k).halfAxes,t=h.Matrix3.getColumn(n,0,P),a=h.Matrix3.getColumn(n,1,p),r=h.Matrix3.getColumn(n,2,M),i=x.Cartesian3.magnitude(t),o=x.Cartesian3.magnitude(a),u=x.Cartesian3.magnitude(r);return!(0===i&&(0===o||0===u)||0===o&&0===u)},n.computeProjectTo2DArguments=function(e,n,t,a){g.Check.defined("positions",e),g.Check.defined("centerResult",n),g.Check.defined("planeAxis1Result",t),g.Check.defined("planeAxis2Result",a);var r,i,o=B.OrientedBoundingBox.fromPoints(e,k),u=o.halfAxes,s=h.Matrix3.getColumn(u,0,P),C=h.Matrix3.getColumn(u,1,p),c=h.Matrix3.getColumn(u,2,M),d=x.Cartesian3.magnitude(s),l=x.Cartesian3.magnitude(C),m=x.Cartesian3.magnitude(c),f=Math.min(d,l,m);return(0!==d||0!==l&&0!==m)&&(0!==l||0!==m)&&(f!==l&&f!==m||(r=s),f===d?r=C:f===m&&(i=C),f!==d&&f!==l||(i=c),x.Cartesian3.normalize(r,t),x.Cartesian3.normalize(i,a),x.Cartesian3.clone(o.center,n),!0)},n.createProjectPointsTo2DFunction=function(a,r,i){return function(e){for(var n=new Array(e.length),t=0;t<e.length;t++)n[t]=o(e[t],a,r,i);return n}},n.createProjectPointTo2DFunction=function(t,a,r){return function(e,n){return o(e,t,a,r,n)}},e.CoplanarPolygonGeometryLibrary=n});