@any-touch/compute
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
import{getAngle as t,radianToAngle as n,getVLength as r,getDirection as a}from"@any-touch/vector";import{TYPE_START as e,TYPE_MOVE as o,CLIENT_X as i,CLIENT_Y as u,round2 as c,COMPUTE_INTERVAL as p}from"@any-touch/shared";function s(){var n=0,r=0;return function(a,e){var o=e.prevVecotr,i=e.startVecotr,u=e.activeVecotr;return u&&(r=Math.round(t(u,o)),n=Math.round(t(u,i))),{angle:n,deltaAngle:r}}}function v(){return function(t){var r=t.prevInput,a=0,e=0,o=0;if(void 0!==r&&(a=t.x-r.x,e=t.y-r.y,0!==a||0!==e)){var i=Math.sqrt(Math.pow(a,2)+Math.pow(e,2));o=Math.round(n(Math.acos(Math.abs(a)/i)))}return{deltaX:a,deltaY:e,deltaXYAngle:o}}}function d(){var t,n=0,c=0,p=0,s=0,v=0;return function(d){var h=d.phase,f=d.startInput;return e===h?(n=0,c=0,p=0,s=0,v=0):o===h&&(n=Math.round(d.points[0][i]-f.points[0][i]),c=Math.round(d.points[0][u]-f.points[0][u]),p=Math.abs(n),s=Math.abs(c),v=Math.round(r({x:p,y:s})),t=a(n,c)),{displacementX:n,displacementY:c,distanceX:p,distanceY:s,distance:v,overallDirection:t}}}function h(){var t=1,n=1;return function(a,e){var o=e.prevVecotr,i=e.startVecotr,u=e.activeVecotr;return u&&(t=c(r(u)/r(o)),n=c(r(u)/r(i))),{scale:n,deltaScale:t}}}function f(){var t,n,r=0,e=0,o=0,i=0;return function(u){if(void 0!==u){n=n||u.startInput;var c=u.timestamp-n.timestamp;if(p<c){var s=u.x-n.x,v=u.y-n.y;o=Math.round(s/c*100)/100,i=Math.round(v/c*100)/100,r=Math.abs(o),e=Math.abs(i),t=a(s,v)||t,n=u}}return{velocityX:r,velocityY:e,speedX:o,speedY:i,direction:t}}}function M(){var t=0;return function(n){var r=n.phase;return e===r&&(t=n.pointLength),{maxPointLength:t}}}function l(t){return{x:t.points[1][i]-t.points[0][i],y:t.points[1][u]-t.points[0][u]}}function m(){var t,n,r;return function(a){var e=a.prevInput,o=a.startMultiInput;return void 0!==o&&void 0!==e&&a.id!==o.id&&1<e.pointLength&&1<a.pointLength&&(t=l(o),n=l(e),r=l(a)),{startVecotr:t,prevVecotr:n,activeVecotr:r}}}export{s as ComputeAngle,v as ComputeDeltaXY,d as ComputeDistance,M as ComputeMaxLength,h as ComputeScale,f as ComputeVAndDir,m as ComputeVectorForMutli}; | ||
//# sourceMappingURL=index.es.js.map |
{ | ||
"name": "@any-touch/compute", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0-alpha.4", | ||
"main": "dist/index.js", | ||
@@ -14,4 +14,4 @@ "module": "dist/index.es.js", | ||
"dependencies": { | ||
"@any-touch/shared": "^2.0.0-alpha.3", | ||
"@any-touch/vector": "^2.0.0-alpha.3", | ||
"@any-touch/shared": "^2.0.0-alpha.4", | ||
"@any-touch/vector": "^2.0.0-alpha.4", | ||
"tslib": "^2.3.1" | ||
@@ -22,3 +22,3 @@ }, | ||
"sideEffects": false, | ||
"gitHead": "090c02977d2540520f72ff80db445aaff91fd1bf" | ||
"gitHead": "0104cf40d492a3f7927d7f7d07e7ca66cf96f455" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19222
14
78