diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-08-19 18:19:02 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-08-19 18:51:30 -0400 |
| commit | 24870ab6ebd31c18b3533ec96ff04ad16153c844 (patch) | |
| tree | 511da350a0a4d6ad2f7df351880dcf8bf1d17ddd /public/assets/javascripts/rectangles/models/rect.js | |
| parent | 559799f707a8c7fbd0d6296dfbce81ac6f9b376a (diff) | |
bounds tester
Diffstat (limited to 'public/assets/javascripts/rectangles/models/rect.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/models/rect.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/models/rect.js b/public/assets/javascripts/rectangles/models/rect.js index f23ab9e..67852b4 100644 --- a/public/assets/javascripts/rectangles/models/rect.js +++ b/public/assets/javascripts/rectangles/models/rect.js @@ -139,6 +139,7 @@ } Rect.prototype.width = function(){ return this.x.length() } Rect.prototype.height = function(){ return this.y.length() } + Rect.prototype.delta = function(){ return new vec2( this.x.magnitude(), this.y.magnitude() ) } Rect.prototype.toString = function(){ var sides = sidesToString(this.sides) var s = "[" + this.x.toString() + " " + this.y.toString() + "] " + sides |
