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

amotion

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amotion - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

package.json
{
"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;
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