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
MathUtils = MathUtils || {}; | |
MathUtils.level = function(i) { | |
if(i==0) return 1; | |
else return i*MathUtils.level(i-1); | |
} | |
MathUtils.binCoefficient = function(n, i) { | |
return MathUtils.level(n) / ( MathUtils.level(i) * MathUtils.level(n-i) ); |
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
p.__defineGetter__("test", function() { | |
return "testing testing"; | |
}); | |
p.__defineSetter__("test", function() { | |
// DO SOMETHING | |
}); |
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
//float n = 5.0; | |
//float f = 800.0; | |
float getDepth(float z, float n, float f) { | |
return (2.0 * n) / (f + n - z*(f-n)); | |
} |
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
var saveJson = function(obj) { | |
var str = JSON.stringify(obj); | |
var data = encode( str ); | |
var blob = new Blob( [ data ], { | |
type: 'application/octet-stream' | |
}); | |
var url = URL.createObjectURL( blob ); | |
var link = document.createElement( 'a' ); |
NewerOlder