a cubic-bezier solver.
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
"use strict"; | |
var fragmentText = function(ctx, lines, index, maxWidth) { | |
var line = lines[index]; | |
var nextLine; | |
var tooLong = true; | |
while (tooLong) { | |
var width = ctx.measureText(line.join(" ")).width; |
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
another requirebin equation-designer early demo |
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
an old test on 3d projections of vertices onto the screen |
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
/* | |
Unmatrix 2d | |
- a crude implementation of the slightly bugged pseudo code in http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition | |
*/"use strict" | |
// returns the length of the passed vector | |
var length = function(a){ | |
return Math.sqrt(a[0] * a[0] + a[1] * a[1]) | |
} |
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
// Array shuffle for MooTools | |
Array.implement({ | |
shuffle: function(){ | |
var i = this.length; | |
if (i == 0) return; | |
while (--i){ | |
var j = Math.floor(Math.random() * ( i + 1 )); | |
var tempi = this[i]; |
NewerOlder