From 775dfb42834bb05b5a7e10af695bc4d7f516026d Mon Sep 17 00:00:00 2001 From: dethe Date: Sun, 31 Jan 2016 11:54:34 -0800 Subject: [PATCH] move distance to utilities --- js/app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/app.js b/js/app.js index b948bbb..47c6dcf 100644 --- a/js/app.js +++ b/js/app.js @@ -29,6 +29,11 @@ function deleteItem(list, item) { return item; } +function distance(x1, y1, x2, y2){ + var val = Math.sqrt(Math.pow(x2-x1, 2) + Math.pow(y2-y1, 2)); + return val; +} + function getGroup(id){ return [].slice.call(Snap.selectAll('path')).filter(function(e){ return e.attr('group') === id; @@ -303,11 +308,6 @@ Snap.plugin(function (Snap, Element, Paper, global, Fragment) { Element.prototype.endPulse = function(){ }; - function distance(x1, y1, x2, y2){ - var val = Math.sqrt(Math.pow(x2-x1, 2) + Math.pow(y2-y1, 2)); - return val; - } - Element.prototype.intersects = function(e){ var selfType = this.attr('type'); var otherType = e.attr('type');