Comparing version 0.1.0 to 0.1.1
@@ -96,2 +96,8 @@ var util = require('util'); | ||
}; | ||
Vec3.prototype.min = function(other) { | ||
return new Vec3(Math.min(this.x, other.x), Math.min(this.y, other.y), Math.min(this.z, other.z)); | ||
}; | ||
Vec3.prototype.max = function(other) { | ||
return new Vec3(Math.max(this.x, other.x), Math.max(this.y, other.y), Math.max(this.z, other.z)); | ||
}; | ||
@@ -98,0 +104,0 @@ function euclideanMod(numerator, denominator) { |
{ | ||
"name": "vec3", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "3d vector math with good unit tests", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -182,2 +182,18 @@ var v = require('../') | ||
}); | ||
it("min", function() { | ||
var v1 = new Vec3(-1, 0, 1); | ||
var v2 = new Vec3(10, -10, 1.1); | ||
var v3 = v1.min(v2); | ||
assert.strictEqual(v3.x, -1); | ||
assert.strictEqual(v3.y, -10); | ||
assert.strictEqual(v3.z, 1); | ||
}); | ||
it("max", function() { | ||
var v1 = new Vec3(-1, 0, 1); | ||
var v2 = new Vec3(10, -10, 1.1); | ||
var v3 = v1.max(v2); | ||
assert.strictEqual(v3.x, 10); | ||
assert.strictEqual(v3.y, 0); | ||
assert.strictEqual(v3.z, 1.1); | ||
}); | ||
}); |
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
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
9535
295