@any-touch/vector
Advanced tools
Comparing version 0.7.8 to 0.7.9
@@ -1,2 +0,3 @@ | ||
declare const _default: (v1: any, v2: any) => number; | ||
import { Vector } from '@any-touch/shared'; | ||
declare const _default: (v1: Vector, v2: Vector) => number; | ||
/** | ||
@@ -3,0 +4,0 @@ * 向量夹角(角度) |
@@ -1,2 +0,3 @@ | ||
declare const _default: (v1: any, v2: any) => number; | ||
import { Vector } from '@any-touch/shared'; | ||
declare const _default: (v1: Vector, v2: Vector) => number; | ||
/** | ||
@@ -3,0 +4,0 @@ * 求旋转方向 |
@@ -1,2 +0,3 @@ | ||
declare const _default: (x: number, y: number) => any; | ||
import { directionString } from '@any-touch/shared'; | ||
declare const _default: (x: number, y: number) => directionString; | ||
/** | ||
@@ -3,0 +4,0 @@ * |
@@ -1,2 +0,3 @@ | ||
declare const _default: (v1: any, v2: any) => number; | ||
import { Vector } from '@any-touch/shared'; | ||
declare const _default: (v1: Vector, v2: Vector) => number; | ||
/** | ||
@@ -3,0 +4,0 @@ * 点积 |
@@ -1,2 +0,3 @@ | ||
declare const _default: (v1: any, v2: any) => number; | ||
import { Vector } from '@any-touch/shared'; | ||
declare const _default: (v1: Vector, v2: Vector) => number; | ||
/** | ||
@@ -3,0 +4,0 @@ * 向量夹角(弧度) |
@@ -1,2 +0,3 @@ | ||
declare const _default: (v: any) => number; | ||
import { Vector } from '@any-touch/shared'; | ||
declare const _default: (v: Vector) => number; | ||
/** | ||
@@ -3,0 +4,0 @@ * 获取向量长度(向量模) |
@@ -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.8", | ||
"version": "0.7.9", | ||
"description": "any-touch中向量计算相关的函数.", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@any-touch/shared": "^0.7.8", | ||
"@any-touch/shared": "^0.7.9", | ||
"tslib": "^1.9.3" | ||
@@ -21,3 +21,3 @@ }, | ||
"sideEffects": false, | ||
"gitHead": "14f864223c9a4df212561b9a53e93a5f89217b15" | ||
"gitHead": "4d795d9ac1c0cf597db9bc070284f3de7578e5fd" | ||
} |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
5373
101
Updated@any-touch/shared@^0.7.9