(function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.geom2d=e():t.geom2d=e()})("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=2)}([function(t,e,n){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,n=(t+"e").split("e");return n=(Math.round(Number(n[0]+"e"+(+n[1]+e)))+"e").split("e"),Number(n[0]+"e"+(+n[1]-e))}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"isNumeric",function(){return i}),n.d(e,"PRECISION",function(){return o}),n.d(e,"EPSILON",function(){return a}),n.d(e,"DIGITIZE_PRECISION",function(){return s}),n.d(e,"AngularSystem",function(){return u}),n.d(e,"getRadians",function(){return c}),n.d(e,"getDegrees",function(){return h}),n.d(e,"getGradians",function(){return f}),e.roundNumber=r,n.d(e,"fixDec",function(){return y});var i=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},o=10,a=Number("1e-"+o),s=2,u=Object.freeze({RADIAN:{id:0,max:2*Math.PI},DEGREE:{id:1,max:360},GRADIAN:{id:2,max:400}}),c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.DEGREE;return t*(u.RADIAN.max/e.max)},h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.RADIAN;return t*(u.DEGREE.max/e.max)},f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.DEGREE;return t*(u.GRADIAN.max/e.max)},y=function(t){return parseFloat(Number(t).toFixed(s))}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(0),o=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;r(this,t),"number"==typeof e[0]&&"number"==typeof e[1]?(this.x=e[0],this.y=e[1]):(this.x=e,this.y=n)}return o(t,[{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:",",e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return e?"("+Object(i.roundNumber)(this.x,n)+t+" "+Object(i.roundNumber)(this.y,2)+")":""+Object(i.roundNumber)(this.x,n)+t+" "+Object(i.roundNumber)(this.y,2)}},{key:"toArray",value:function(){return[this.x,this.y]}},{key:"toWKT",value:function(){return"POINT("+this.x+" "+this.y+")"}},{key:"toEWKT",value:function(){return"SRID="+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:21781)+";POINT("+this.x+" "+this.y+")"}},{key:"toGeoJSON",value:function(){return'{"type":"Point","coordinates":['+this.x+","+this.y+"]}"}},{key:"moveToArray",value:function(t){if(Object(i.isNumeric)(t[0])&&Object(i.isNumeric)(t[1]))return this.x=t[0],this.y=t[1],this;throw new TypeError("moveToArray needs an array of 2 numbers like this [1.0, 2.0]")}},{key:"moveTo",value:function(t,e){if(Object(i.isNumeric)(t)&&Object(i.isNumeric)(e))return this.x=t,this.y=e,this;throw new TypeError("moveTo needs newX and newY to be valid numbers !")}},{key:"moveRelArray",value:function(t){if(Object(i.isNumeric)(t[0])&&Object(i.isNumeric)(t[1]))return this.x=this.x+t[0],this.y=this.y+t[1],this;throw new TypeError("moveRelArray needs an array of 2 numbers like this [1.0, 2.0]")}},{key:"moveRel",value:function(t,e){if(Object(i.isNumeric)(t)&&Object(i.isNumeric)(e))return this.x=this.x+t,this.y=this.y+e,this;throw new TypeError("moveRel needs deltaX and deltaY to be valid numbers !")}},{key:"moveRelPolar",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.AngularSystem.DEGREE,o=t.fromPolar(e,n,r);return this.x=this.x+o.x,this.y=this.y+o.y,this}},{key:"copyRelArray",value:function(e){if(Object(i.isNumeric)(e[0])&&Object(i.isNumeric)(e[1])){var n=t.fromPoint(this);return n.x=n.x+e[0],n.y=n.y+e[1],n}throw new TypeError("copyRelArray needs an array of 2 numbers like this [1.0, 2.0]")}},{key:"copyRel",value:function(e,n){if(Object(i.isNumeric)(e)&&Object(i.isNumeric)(n)){var r=t.fromPoint(this);return r.x=r.x+e,r.y=r.y+n,r}throw new TypeError("copyRel needs deltaX and deltaY to be valid numbers !")}},{key:"copyRelPolar",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.AngularSystem.DEGREE,o=t.fromPolar(e,n,r),a=t.fromPoint(this);return a.x=a.x+o.x,a.y=a.y+o.y,a}},{key:"equal",value:function(e){if(e instanceof t)return Math.abs(this.x-e.x)<=i.EPSILON&&Math.abs(this.y-e.y)<=i.EPSILON;throw new TypeError("A Point can only be compared to another Point")}},{key:"distance",value:function(e){if(e instanceof t){var n=Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y));return n<=i.EPSILON?0:n}throw new TypeError("Point.distance(otherPoint) expects a Point as parameter")}},{key:"x",get:function(){return this._x},set:function(t){if(!Object(i.isNumeric)(t))throw this._x=NaN,this.isInvalid=!0,this.InvalidReason="cannot set x to "+t+" because it is not a numeric value",new TypeError("Point.x setter needs a numeric value and "+t+" is not");this._x=parseFloat(t)}},{key:"y",get:function(){return this._y},set:function(t){if(!Object(i.isNumeric)(t))throw this._y=NaN,this.isInvalid=!0,this.InvalidReason="cannot set y to "+t+" because it is not a numeric value",new TypeError("Point.y setter needs a numeric value and "+t+" is not");this._y=parseFloat(t)}}],[{key:"fromPolar",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.AngularSystem.DEGREE;if(Object(i.isNumeric)(e)&&Object(i.isNumeric)(n)){var o=0;o=r===i.AngularSystem.RADIAN?n:Object(i.getRadians)(n);var a=new t;a._radius=e,a._theta=o;var s=e*Math.cos(o);a.x=Math.abs(s)<=i.EPSILON?0:Object(i.roundNumber)(s,i.PRECISION);var u=e*Math.sin(o);return a.y=Math.abs(u)<=i.EPSILON?0:Object(i.roundNumber)(u,i.PRECISION),a}throw new TypeError("fromPolar needs radius and theta to be valid numbers !")}},{key:"fromPoint",value:function(e){if(e instanceof t)return new t(e.x,e.y);throw new TypeError("fromPoint needs parameter otherPoint of type Point")}}]),t}();e.a=a},function(t,e,n){t.exports=n(3)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=n(4),o=n(0);n.d(e,"Point",function(){return r.a}),n.d(e,"Line",function(){return i.a}),n.d(e,"utils",function(){return o})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(1),o=n(0),a=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:new i.a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.a(1,1),o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r(this,t),this._options=Object.assign({},s,o),this.startPoint=e,this.endPoint=n}return a(t,[{key:"toString",value:function(){return"Line("+this.startPoint.toString()+" -> "+this.endPoint.toString()+")"}},{key:"toArray",value:function(){var t=[];return t.push(this.startPoint.toArray()),t.push(this.endPoint.toArray()),t}},{key:"toWKT",value:function(){return"LINESTRING("+this.startPoint.x+" "+this.startPoint.y+", "+this.endPoint.x+" "+this.endPoint.y+")"}},{key:"toEWKT",value:function(){return"SRID="+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:21781)+";LINESTRING("+this.startPoint.x+" "+this.startPoint.y+", "+this.endPoint.x+" "+this.endPoint.y+")"}},{key:"toGeoJSON",value:function(){return'{"type":"LineString","coordinates":[['+this.startPoint.x+","+this.startPoint.y+"],["+this.endPoint.x+","+this.endPoint.y+"]]}"}},{key:"getLength",value:function(){return this.startPoint.distance(this.endPoint)}},{key:"getVectorArray",value:function(){var t=[];return t.push(this.endPoint.x-this.startPoint.x),t.push(this.endPoint.y-this.startPoint.y),t}},{key:"getSlope",value:function(){var t=this.getVectorArray();return t[0]