-
Notifications
You must be signed in to change notification settings - Fork 2
/
trigfills.min.js
1 lines (1 loc) · 1.77 KB
/
trigfills.min.js
1
var trigfillfactory=function(){function t(){return"0.9.5"}function n(t,n){return t-Math.floor(t/n)*n}function r(t,n){return t-Math.floor(t/n+.5)*n}function a(t){if(t-=Math.floor(t/d)*d,t>M&&(t=d-t),t>=v){var n=-1;t=M-t}else n=1;return t>g?n*i(v-t):n*e(t)}function o(t){if(t-=Math.floor(t/d)*d,t>M){var n=-1;t-=M}else n=1;return t>=v&&(t=M-t),t>g?n*e(v-t):n*i(t)}function e(t){var n=t*t,r=n*n;return 1-.5*n+r*w-r*n*I+r*r*P}function i(t){var n=t*t*t,r=n*n;return t-n*q+n*t*t*x-r*t*j+r*n*T}function f(t){var n=1,r=!1,a=!1;0>t&&(n=-1,t=-t),t>1&&(t=1/t,r=!0),t>.26794919&&(t=(y*t-1)/(y+t),a=!0);var o=t*t,e=o*o,i=e*e*t;return t=t-t*o*b+e*t*k-e*o*t*z+i*A-i*o*B,a&&(t+=m),r&&(t=v-t),t*n}function u(t,n){if(0===n)return 0===t?0:0>t?-v:v;var r=f(t/n);return n>0?r:(0>t?r-=M:r+=M,r-Math.floor(r/d+.5)*d)}function l(t){var r=1,a=!1,o=!1;t=.9999999999999999*n(t,M),t>v&&(t=M-t,r=-1),t>g&&(t=v-t,a=!0),t>p&&(t=.5*t,o=!0);var e=t*t,i=e*e,f=i*i*t;return t=t+t*e*C+i*t*D+i*e*t*E+f*F+f*e*G,o&&(t=2*t/(1-t*t)),a&&(t=1/t),t*r}function s(t){return-1==t?Math.PI:n(f(Math.sqrt(1-t*t)/t),Math.PI)}function c(t){return f(t/Math.sqrt(1-t*t))}function h(){Math.sin=o,Math.cos=a,Math.tan=l,Math.acos=s,Math.asin=c,Math.atan=f,Math.atan2=u,Math.hasTrigfills=t()}var M=Math.PI,d=2*M,v=M/2,g=M/4,m=M/6,p=M/8,y=1.7320508075688772,w=1e5/2399999,I=1e5/71998376,P=1e3/40578583,q=1e8/600000005,x=1/120,j=1e3/5039680,T=10/3628880,b=.3333333342477778,k=1e7/50000082,z=1e5/700011,A=1e4/90019,B=1e3/11768,C=1e9/2999999887,D=2e8/1500000678,E=17e4/3150457,F=6200/282874,G=1382/146286;return{sin:o,cos:a,tan:l,acos:s,asin:c,atan:f,atan2:u,modp:n,modn:r,setmaths:h,version:t}};"undefined"!=typeof module&&module.exports?module.exports=trigfillfactory():"undefined"!=typeof window?window.trigfills=trigfillfactory():console.log("trigfills.js did not import");