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

vec3

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vec3 - npm Package Compare versions

Comparing version 0.0.8 to 0.1.0

10

index.js

@@ -76,3 +76,6 @@ var util = require('util');

Vec3.prototype.modulus = function(other) {
return new Vec3(this.x % other.x , this.y % other.y, this.z % other.z);
return new Vec3(
euclideanMod(this.x, other.x),
euclideanMod(this.y, other.y),
euclideanMod(this.z, other.z));
};

@@ -94,1 +97,6 @@ Vec3.prototype.distanceTo = function(other) {

};
function euclideanMod(numerator, denominator) {
var result = numerator % denominator;
return result < 0 ? result + denominator : result;
}

2

package.json
{
"name": "vec3",
"version": "0.0.8",
"version": "0.1.0",
"description": "3d vector math with good unit tests",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -165,14 +165,14 @@ var v = require('../')

it("modulus", function() {
var v1 = new Vec3(12, 32, 46);
var v2 = new Vec3(14, 32, 44);
var v1 = new Vec3(12, 32, -1);
var v2 = new Vec3(14, 32, 16);
var v3 = v1.modulus(v2);
assert.strictEqual(v1.x, 12);
assert.strictEqual(v1.y, 32);
assert.strictEqual(v1.z, 46);
assert.strictEqual(v1.z, -1);
assert.strictEqual(v2.x, 14);
assert.strictEqual(v2.y, 32);
assert.strictEqual(v2.z, 44);
assert.strictEqual(v2.z, 16);
assert.strictEqual(v3.x, 12);
assert.strictEqual(v3.y, 0);
assert.strictEqual(v3.z, 2);
assert.strictEqual(v3.z, 15);
});

@@ -179,0 +179,0 @@ it("volume", function() {

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