@any-touch/vector
Advanced tools
Comparing version 2.0.0 to 2.0.1-alpha.0
import { directionString } from '@any-touch/shared'; | ||
declare const _default: (x: number, y: number) => directionString; | ||
declare const _default: (x: number, y: number) => directionString | undefined; | ||
/** | ||
@@ -4,0 +4,0 @@ * 计算点相对于(0,0)的方向 |
@@ -1,2 +0,2 @@ | ||
import{DIRECTION_RIGHT as r,DIRECTION_LEFT as t,DIRECTION_DOWN as n,DIRECTION_UP as u}from"@any-touch/shared";var a=function(r){return Math.sqrt(r.x*r.x+r.y*r.y)},o=function(r,t){return r.x*t.x+r.y*t.y},e=function(r,t){var n=a(r)*a(t);if(0===n)return 0;var u=o(r,t)/n;return u>1&&(u=1),Math.acos(u)},c=function(r,t){return r.x*t.y-t.x*r.y},f=function(r){return r/Math.PI*180},i=function(r,t){var n=e(r,t);return c(r,t)>0&&(n*=-1),f(n)},h=function(a,o){return Math.abs(a)>=Math.abs(o)?0<a?r:t:0<o?n:u};export{i as getAngle,c as getCross,h as getDirection,o as getDotProduct,e as getRadian,a as getVLength,f as radianToAngle}; | ||
import{DIRECTION_RIGHT as r,DIRECTION_LEFT as t,DIRECTION_DOWN as n,DIRECTION_UP as u}from"@any-touch/shared";var a=function(r){return Math.sqrt(r.x*r.x+r.y*r.y)},o=function(r,t){return r.x*t.x+r.y*t.y},e=function(r,t){var n=a(r)*a(t);if(0===n)return 0;var u=o(r,t)/n;return u>1&&(u=1),Math.acos(u)},f=function(r,t){return r.x*t.y-t.x*r.y},i=function(r){return r/Math.PI*180},c=function(r,t){var n=e(r,t);return f(r,t)>0&&(n*=-1),i(n)},h=function(a,o){if(0!==a||0!==o)return Math.abs(a)>=Math.abs(o)?0<a?r:t:0<o?n:u};export{c as getAngle,f as getCross,h as getDirection,o as getDotProduct,e as getRadian,a as getVLength,i as radianToAngle}; | ||
//# sourceMappingURL=index.es.js.map |
@@ -1,1 +0,1 @@ | ||
"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 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; | ||
"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){if(0!==r||0!==e)return 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": "2.0.0", | ||
"version": "2.0.1-alpha.0", | ||
"description": "any-touch中向量计算相关的函数.", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@any-touch/shared": "^2.0.0" | ||
"@any-touch/shared": "^2.0.1-alpha.0" | ||
}, | ||
@@ -20,3 +20,3 @@ "publishConfig": { | ||
"sideEffects": false, | ||
"gitHead": "fbbe6448895509158a8a9f4e68be2e6ebc7c7fb6" | ||
"gitHead": "8e3fda195ba6edbf27e7cc8a0f0379e02c05ca49" | ||
} |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
6182
3