diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-08-22 19:41:37 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-08-22 19:41:37 -0400 |
| commit | 2235c34e498499b8141e835998b962067583a0ce (patch) | |
| tree | 22406e6484a7cccc1c72fb47cc4e5848f57ee2c4 /public/assets/javascripts/rectangles/models/vec2.js | |
| parent | ed5751766079a62ce596dcc0abc1a211b5b633dc (diff) | |
| parent | 4ef340497ef24bb2ecacb2c9c4106c24515c874f (diff) | |
merge
Diffstat (limited to 'public/assets/javascripts/rectangles/models/vec2.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/models/vec2.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/public/assets/javascripts/rectangles/models/vec2.js b/public/assets/javascripts/rectangles/models/vec2.js index 214feb9..0040435 100644 --- a/public/assets/javascripts/rectangles/models/vec2.js +++ b/public/assets/javascripts/rectangles/models/vec2.js @@ -20,6 +20,7 @@ vec2.prototype.assign = function(v){ this.a = v.a this.b = v.b + return this } vec2.prototype.abs = function(){ if (this.b < this.a) { @@ -123,12 +124,12 @@ } vec2.prototype.union = function(v){ if (this.intersects(v)) { - return new vec2( min(this.a,v.a), max(this.b, v.b) ) + return new vec2( Math.min(this.a,v.a), Math.max(this.b, v.b) ) } } vec2.prototype.intersection = function(v){ if (this.intersects(v)) { - return new vec2( max(this.a,v.a), min(this.b, v.b) ) + return new vec2( Math.max(this.a,v.a), Math.min(this.b, v.b) ) } } |
