Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@any-touch/vector

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@any-touch/vector - npm Package Compare versions

Comparing version 0.7.6 to 0.7.7

2

dist/index.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var shared=require("@any-touch/shared"),getVLength=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},getDotProduct=function(t,e){return t.x*e.x+t.y*e.y},getRadian=function(t,e){var r=getVLength(t)*getVLength(e);if(0===r)return 0;var n=getDotProduct(t,e)/r;return n>1&&(n=1),Math.acos(n)},getCross=function(t,e){return t.x*e.y-e.x*t.y},radianToAngle=function(t){return t/Math.PI*180},getAngle=function(t,e){var r=getRadian(t,e);return getCross(t,e)>0&&(r*=-1),radianToAngle(r)},getDirection=function(t,e){return t===e?shared.NONE:Math.abs(t)>Math.abs(e)?0<t?shared.DIRECTION_RIGHT:shared.DIRECTION_LEFT:0<e?shared.DIRECTION_DOWN:shared.DIRECTION_UP};exports.getAngle=getAngle,exports.getCross=getCross,exports.getDirection=getDirection,exports.getDotProduct=getDotProduct,exports.getRadian=getRadian,exports.getVLength=getVLength,exports.radianToAngle=radianToAngle;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@any-touch/shared"),r=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e=function(t,r){return t.x*r.x+t.y*r.y},n=function(t,n){var o=r(t)*r(n);if(0===o)return 0;var u=e(t,n)/o;return u>1&&(u=1),Math.acos(u)},o=function(t,r){return t.x*r.y-r.x*t.y},u=function(t){return t/Math.PI*180};exports.getAngle=function(t,r){var e=n(t,r);return o(t,r)>0&&(e*=-1),u(e)},exports.getCross=o,exports.getDirection=function(r,e){return r===e?t.NONE:Math.abs(r)>Math.abs(e)?0<r?t.DIRECTION_RIGHT:t.DIRECTION_LEFT:0<e?t.DIRECTION_DOWN:t.DIRECTION_UP},exports.getDotProduct=e,exports.getRadian=n,exports.getVLength=r,exports.radianToAngle=u;
{
"name": "@any-touch/vector",
"version": "0.7.6",
"version": "0.7.7",
"description": "any-touch中向量计算相关的函数.",

@@ -10,3 +10,3 @@ "main": "dist/index.js",

"dependencies": {
"@any-touch/shared": "^0.7.6",
"@any-touch/shared": "^0.7.7",
"tslib": "^1.9.3"

@@ -21,3 +21,3 @@ },

"sideEffects": false,
"gitHead": "5f800767f00a55aff8d355b901360c9aedd12485"
"gitHead": "4c1eb288b7a1f3bab7e1bebc3a225aff86b91e08"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc