text: !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.geometric={})}(this,function(n){"use strict";function t(n){return 180*n/Math.PI}function r(n){return t(Math.atan2(n[1][1]-n[0][1],n[1][0]-n[0][0]))}function e(n){return Math.sqrt(Math.pow(n[1][0]-n[0][0],2)+Math.pow(n[1][1]-n[0][1],2))}function o(n){return n/180*Math.PI}function i(n,t,r){var e=o(t);return[n[0]+r*Math.cos(e),n[1]+r*Math.sin(e)]}function u(n){return function(t){return 0===t?n[0]:1===t?n[1]:i(n[0],r(n),e(n)*t)}}function a(n){return[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]}function f(n,t,r){function e(n,t){return[n[0]*Math.cos(t)-n[1]*Math.sin(t),n[0]*Math.sin(t)+n[1]*Math.cos(t)]}var i=o(t);return!r||0===r[0]&&0===r[1]?e(n,i):e(n.map(function(n,t){return n-r[t]}),i).map(function(n,t){return n+r[t]})}function l(n){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0,e=0,o=n.length;e<o;e++){var i=n[e],u=n[e===o-1?0:e+1];r+=i[0]*u[1],r-=u[0]*i[1]}return t?r/2:Math.abs(r/2)}function c(n){if(n.length<3)return null;for(var t=1/0,r=-1/0,e=1/0,o=-1/0,i=!1,u=0,a=n.length;u<a;u++){var f=n[u],l=f[0],c=f[1];null!=l&&isFinite(l)&&null!=c&&isFinite(c)&&(i=!0,l<t&&(t=l),l>r&&(r=l),c<e&&(e=c),c>o&&(o=c))}return i?[[t,e],[r,o]]:null}function g(n){for(var t=0,r=0,e=0,o=n.length,i=0;i<o;i++){var u=i===o-1?0:i+1,a=n[i],f=n[u],l=a[0]*f[1]-f[0]*a[1];t+=l,r+=(a[0]+f[0])*l,e+=(a[1]+f[1])*l}var c=3*t;return[r/c,e/c]}function h(n,t,r){return(n[0]-r[0])*(t[1]-r[1])-(n[1]-r[1])*(t[0]-r[0])}function v(n){if(n.length<3)return null;for(var t=n.slice().sort(function(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}),r=[],e=0;e<t.length;e++){for(;r.length>=2&&h(r[r.length-2],r[r.length-1],t[e])<=0;)r.pop();r.push(t[e])}for(var o=[],i=t.length-1;i>=0;i--){for(;o.length>=2&&h(o[o.length-2],o[o.length-1],t[i])<=0;)o.pop();o.push(t[i])}return o.pop(),r.pop(),r.concat(o)}function p(n){if(0===n.length)return 0;for(var t,r,e=-1,o=n.length,i=n[o-1],u=i[0],a=i[1],f=0;++e<o;)t=u,r=a,i=n[e],u=i[0],a=i[1],t-=u,r-=a,f+=Math.sqrt(t*t+r*r);return f}function s(n){for(var t=0,r=0,e=n.length,o=0;o<e;o++){var i=n[o];t+=i[0],r+=i[1]}return[t/e,r/e]}function y(n,t,r){for(var e=[],o=0,u=n.length;o<u;o++)e[o]=i(n[o],t,r);return e}function d(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,o=arguments.length>2?arguments[2]:void 0,u=[],a=[0,0],f=[0,0],l=0,c=0;c<n;c++)u[c]=a,f[0]+=a[0],f[1]+=a[1],a=i(a,l,Math.sqrt(4*t*Math.tan(Math.PI/n)/n)),l-=360/n;if(o){var g=[[f[0]/n,f[1]/n],o];u=y(u,r(g),e(g))}return u}function M(n,t,r){for(var e=[],o=0,i=n.length;o<i;o++)e[o]=f(n[o],t,r);return e}function b(n,t,o){o||(o=g(n));for(var u=[],a=0,f=n.length;a<f;a++){var l=n[a],c=e([o,l]),h=r([o,l]);u[a]=i(o,h,c*t)}return u}function m(n,t,o){o||(o=g(n));for(var u=[],a=0,f=n.length;a<f;a++){var l=n[a],c=e([o,l]),h=r([o,l]),v=i(o,h,c*t);u[a]=[v[0],l[1]]}return u}function I(n,t,o){o||(o=g(n));for(var u=[],a=0,f=n.length;a<f;a++){var l=n[a],c=e([o,l]),h=r([o,l]),v=i(o,h,c*t);u[a]=[l[0],v[1]]}return u}function A(n,t){if(L(n,t))return!0;var r,e,o,i=n[0][0],u=n[0][1],a=n[1][0],f=n[1][1],l=t[0][0],c=t[0][1],g=t[1][0],h=t[1][1];return 0!==(r=(a-i)*(h-c)-(g-l)*(f-u))&&(o=((h-c)*(g-i)+(l-g)*(h-u))/r,e=((u-f)*(g-i)+(a-i)*(h-u))/r,0<o&&o<1&&0<e&&e<1)}function L(n,t){for(var r=!1,e=0;e<2;e++)for(var o=0;o<2;o++)if(P(n[e],t[o])){r=!0;break}return r}function P(n,t){return n[0]===t[0]&&n[1]===t[1]}function S(n,t,r){return[t[0]-r[0],t[1]-r[1]]}function k(n,t){return n[0]*t[1]-t[0]*n[1]}function R(n,t,r,e){var o=S([],e,r),i=S([],n,r),u=S([],t,r);return k(o,i)*k(o,u)<=0}function j(n,t){return R(n[0],n[1],t[0],t[1])&&R(t[0],t[1],n[0],n[1])}function w(n){return O(n)||T(n)||q(n)||C()}function O(n){if(Array.isArray(n))return x(n)}function T(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}function q(n,t){if(n){if("string"==typeof n)return x(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(n,t):void 0}}function x(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=n[r];return e}function C(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(n){return _(n)?n:[].concat(w(n),[n[0]])}function _(n){var t=n[0],r=n[n.length-1];return t[0]===r[0]&&t[1]===r[1]}function B(n){return n[1][1]>n[0][1]?n:[n[1],n[0]]}function D(n,t){var r=B(t);return h(n,r[1],r[0])<0}function E(n,t){var r=B(t);return h(n,r[1],r[0])>0}function H(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=e(t);return U(n,t,r)&&e([t[0],n])<=o&&e([t[1],n])<=o}function U(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.abs(h(n,t[0],t[1]))<=r}function W(n,t){for(var r=!1,e=F(t),o=0,i=e.length-1;o<i;o++){var u=e[o],a=e[o+1];if(A(n,[u,a])||H(u,n)&&H(a,n)){r=!0;break}}return r}function X(n,t){for(var r=n[0],e=n[1],o=!1,i=0,u=t.length-1;i<t.length;u=i++){var a=t[i][0],f=t[i][1],l=t[u][0],c=t[u][1];f>e!=c>e&&r<(l-a)*(e-f)/(c-f)+a&&(o=!o)}return o}function Y(n,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e=!1,o=F(t),i=0,u=o.length-1;i<u;i++)if(H(n,[o[i],o[i+1]],r)){e=!0;break}return e}function $(n,t){for(var r=!0,e=F(n),o=0,i=e.length-1;o<i;o++){var u=e[o];if(!X(u,t)){r=!1;break}if(W([u,e[o+1]],t)){r=!1;break}}return r}function z(n,t){for(var r=!1,e=0,o=F(n),i=0,u=o.length-1;i<u;i++){var a=o[i];if(W([a,o[i+1]],t)){r=!0;break}if(Y(a,t)&&++e,2===e){r=!0;break}}return r}function G(n,t){var r=2*t-n;return r>=360?r-360:r<0?r+360:r}var J=[[50.054358,8.693184],[50.055604,8.685873]],K=[[50.054228,8.69338],[50.054358,8.693184]],N=j(J,K),Q=j(K,J);console.log(N,Q),n.lineAngle=r,n.lineInterpolate=u,n.lineLength=e,n.lineMidpoint=a,n.pointRotate=f,n.pointTranslate=i,n.polygonArea=l,n.polygonBounds=c,n.polygonCentroid=g,n.polygonHull=v,n.polygonLength=p,n.polygonMean=s,n.polygonRegular=d,n.polygonRotate=M,n.polygonScale=b,n.polygonScaleX=m,n.polygonScaleY=I,n.polygonTranslate=y,n.lineIntersectsLine=A,n.isLineCross=j,n.lineIntersectsPolygon=W,n.pointInPolygon=X,n.pointOnPolygon=Y,n.pointLeftofLine=D,n.pointRightofLine=E,n.pointOnLine=H,n.pointWithLine=U,n.polygonInPolygon=$,n.polygonIntersectsPolygon=z,n.angleReflect=G,n.angleToDegrees=t,n.angleToRadians=o,Object.defineProperty(n,"__esModule",{value:!0})});