Skip to content

Instantly share code, notes, and snippets.

@pvdz
Created August 23, 2012 12:51
Show Gist options
  • Save pvdz/3436333 to your computer and use it in GitHub Desktop.
Save pvdz/3436333 to your computer and use it in GitHub Desktop.
var ordered = pieces.slice(i).sort(function(a,b){
var pa = this.distanceBetween(p,a);
var pb = this.distanceBetween(p.b);
if (pa < pb) return -1;
if (pa > pb) return 1;
return 0;
}.bind(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment