This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bezier(pts) { | |
return function (t) { | |
for (var a = pts; a.length > 1; a = b) // do..while loop in disguise | |
for (var i = 0, b = [], j; i < a.length - 1; i++) // cycle over control points | |
for (b[i] = [], j = 0; j < a[i].length; j++) // cycle over dimensions | |
b[i][j] = a[i][j] * (1 - t) + a[i+1][j] * t; // interpolation | |
return a[0]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
get exact cross browser mouse event coordinates workarounds (relative to offset parent) | |
*/ | |
/* with jquery */ | |
var x = event.offsetX || event.clientX - $(event.target).offset().left, | |
y = event.offsetY || event.clientY - $(event.target).offset().top; | |
/* on svg raphael paper */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Carp qw(cluck); | |
use autodie ':all'; | |
use Getopt::Long 2.33 qw(:config auto_help); | |
use File::Find::Rule; | |
use File::Basename 'basename'; |