Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
|
|
@ -1,11 +1,21 @@
|
|||
var cube:Function = function(x) {
|
||||
return Math.pow(x, 3);
|
||||
};
|
||||
var cuberoot:Function = function(x) {
|
||||
return Math.pow(x, 1/3);
|
||||
};
|
||||
|
||||
function compose(f:Function, g:Function):Function {
|
||||
return function(x:Number) {return f(g(x));};
|
||||
}
|
||||
var functions:Array = [Math.cos, Math.tan, function(x:Number){return x*x;}];
|
||||
var inverse:Array = [Math.acos, Math.atan, function(x:Number){return Math.sqrt(x);}];
|
||||
var functions:Array = [Math.cos, Math.tan, cube];
|
||||
var inverse:Array = [Math.acos, Math.atan, cuberoot];
|
||||
|
||||
function test() {
|
||||
for (var i:uint = 0; i < functions.length; i++) {
|
||||
trace(compose(functions[i], inverse[i])(0.5));
|
||||
// Applying the composition to 0.5
|
||||
trace(compose(functions[i], inverse[i])(0.5));
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue