Skip to content

Commit

Permalink
move distance to utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
dethe committed Jan 31, 2016
1 parent 0ae08d7 commit 775dfb4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/app.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 775dfb4

Please sign in to comment.