From 272474767b6ed1f419843c7a205c16f934eeb84f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 20 Aug 2015 23:33:36 -0400 Subject: turn segments into rects --- public/assets/javascripts/rectangles/models/vec2.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'public/assets/javascripts/rectangles/models/vec2.js') diff --git a/public/assets/javascripts/rectangles/models/vec2.js b/public/assets/javascripts/rectangles/models/vec2.js index 290e45e..90a56c6 100644 --- a/public/assets/javascripts/rectangles/models/vec2.js +++ b/public/assets/javascripts/rectangles/models/vec2.js @@ -43,6 +43,9 @@ vec2.prototype.eq = function(v){ return this.a == v.a && this.b == v.b } + vec2.prototype.isPoint = function(){ + return this.a == this.b + } vec2.prototype.add = function(n){ this.a += n this.b += n -- cgit v1.2.3-70-g09d2