Skip to content

Instantly share code, notes, and snippets.

@nicokruger
Created July 5, 2012 06:46
Show Gist options
  • Save nicokruger/3051867 to your computer and use it in GitHub Desktop.
Save nicokruger/3051867 to your computer and use it in GitHub Desktop.
Rot and join to get pairs
var points = [[-200,-200],[200,-200],[200,200],[-200,200]],
lines = _(points).zip(rot(1, points)).map(function (x) {
var a = x[0], b = x[1];
return makeLine(a[0], a[1], b[0], b[1], 0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment