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

victor

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victor - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

4

bower.json

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

{
u
"name": "victor",

@@ -8,3 +8,3 @@ "main": "build/victor.js",

},
"version": "0.2.4",
"version": "0.2.5",
"homepage": "https://github.com/maxkueng/victor",

@@ -11,0 +11,0 @@ "authors": [

@@ -736,3 +736,25 @@ exports = module.exports = Victor;

/**
* Projects a vector onto another vector, setting itself to the result.
*
* ### Examples:
* var vec = new Victor(100, 0);
* var vec2 = new Victor(100, 100);
*
* vec.projectOnto(vec2);
* vec.toString();
* // => x:50, y:50
*
* @param {Victor} vector The other vector you want to project this vector onto
* @return {Victor} `this` for chaining capabilities
* @api public
*/
Victor.prototype.projectOnto = function (vec2) {
var coeff = ( (this.x * vec2.x)+(this.y * vec2.y) ) / ((vec2.x*vec2.x)+(vec2.y*vec2.y));
this.x = coeff * vec2.x;
this.y = coeff * vec2.y;
return this;
};
Victor.prototype.horizontalAngle = function () {

@@ -739,0 +761,0 @@ return Math.atan2(this.y, this.x);

{
"name": "victor",
"version": "0.2.4",
"version": "0.2.5",
"description": "A JavaScript 2D vector class with methods for common vector operations",

@@ -5,0 +5,0 @@ "keywords": [

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