Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "amotion", | ||
"description": "project description", | ||
"version": "0.1.0", | ||
"description": "A physical mathematical motion functions for javascript", | ||
"version": "0.1.1", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -6,3 +6,3 @@ # amotion | ||
project description | ||
A physical mathematical motion functions for javascript | ||
@@ -9,0 +9,0 @@ ## [Visiting Site](http://amfe.github.io/amotion/) |
'use strict'; | ||
export default class Motion { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Motion = function () { | ||
/** | ||
@@ -14,3 +22,6 @@ * 通过已知的运动参数,推导出其它的位置参数 | ||
*/ | ||
constructor(config) { | ||
function Motion(config) { | ||
_classCallCheck(this, Motion); | ||
this.v = config.v || 0; | ||
@@ -30,3 +41,3 @@ this.a = config.a || 0; | ||
if (typeof this.s === 'undefined') { | ||
this.t = - this.v / this.a; | ||
this.t = -this.v / this.a; | ||
} else { | ||
@@ -52,10 +63,17 @@ var t1 = (Math.sqrt(this.v * this.v + 2 * this.a * this.s) - this.v) / this.a; | ||
*/ | ||
generateCubicBezier (){ | ||
var a = this.v / this.a; | ||
var b = this.t + this.v / this.a; | ||
return [[(a / 3 + (a + b) / 3 - a) / (b - a), (a * a / 3 + a * b * 2 / 3 - a * a) / (b * b - a * a)], | ||
[(b / 3 + (a + b) / 3 - a) / (b - a), (b * b / 3 + a * b * 2 / 3 - a * a) / (b * b - a * a)]]; | ||
} | ||
} | ||
_createClass(Motion, [{ | ||
key: 'generateCubicBezier', | ||
value: function generateCubicBezier() { | ||
var a = this.v / this.a; | ||
var b = this.t + this.v / this.a; | ||
return [[(a / 3 + (a + b) / 3 - a) / (b - a), (a * a / 3 + a * b * 2 / 3 - a * a) / (b * b - a * a)], [(b / 3 + (a + b) / 3 - a) / (b - a), (b * b / 3 + a * b * 2 / 3 - a * a) / (b * b - a * a)]]; | ||
} | ||
}]); | ||
return Motion; | ||
}(); | ||
exports.default = Motion; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
1
5979
3
60