define(["exports","./Cartographic-1d953166","./Check-2514d21d","./when-d186add7","./Math-7f5f2992","./FeatureDetection-4281d393"],(function(t,e,n,o,a,r){"use strict";function i(t,o){if(n.o.typeOf.object("normal",t),!a.e.equalsEpsilon(e.t.magnitude(t),1,a.e.EPSILON6))throw new n.t("normal must be normalized.");n.o.typeOf.number("distance",o),this.normal=e.t.clone(t),this.distance=o}i.fromPointNormal=function(t,r,c){if(n.o.typeOf.object("point",t),n.o.typeOf.object("normal",r),!a.e.equalsEpsilon(e.t.magnitude(r),1,a.e.EPSILON6))throw new n.t("normal must be normalized.");var l=-e.t.dot(r,t);return o.e(c)?(e.t.clone(r,c.normal),c.distance=l,c):new i(r,l)};var c=new e.t;i.fromCartesian4=function(t,r){n.o.typeOf.object("coefficients",t);var l=e.t.fromCartesian4(t,c),f=t.w;if(!a.e.equalsEpsilon(e.t.magnitude(l),1,a.e.EPSILON6))throw new n.t("normal must be normalized.");return o.e(r)?(e.t.clone(l,r.normal),r.distance=f,r):new i(l,f)},i.getPointDistance=function(t,o){return n.o.typeOf.object("plane",t),n.o.typeOf.object("point",o),e.t.dot(t.normal,o)+t.distance};var l=new e.t;i.projectPointOntoPlane=function(t,a,r){n.o.typeOf.object("plane",t),n.o.typeOf.object("point",a),o.e(r)||(r=new e.t);var c=i.getPointDistance(t,a),f=e.t.multiplyByScalar(t.normal,c,l);return e.t.subtract(a,f,r)};var f=new e.t;i.transform=function(t,o,a){return n.o.typeOf.object("plane",t),n.o.typeOf.object("transform",o),r.y.multiplyByPointAsVector(o,t.normal,c),e.t.normalize(c,c),e.t.multiplyByScalar(t.normal,-t.distance,f),r.y.multiplyByPoint(o,f,f),i.fromPointNormal(f,c,a)},i.clone=function(t,a){return n.o.typeOf.object("plane",t),o.e(a)?(e.t.clone(t.normal,a.normal),a.distance=t.distance,a):new i(t.normal,t.distance)},i.equals=function(t,o){return n.o.typeOf.object("left",t),n.o.typeOf.object("right",o),t.distance===o.distance&&e.t.equals(t.normal,o.normal)},i.ORIGIN_XY_PLANE=Object.freeze(new i(e.t.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=Object.freeze(new i(e.t.UNIT_X,0)),i.ORIGIN_ZX_PLANE=Object.freeze(new i(e.t.UNIT_Y,0)),t.o=i}));
