Difference between revisions of "Inverse Composition Rules"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||
Line 47: | Line 47: | ||
var change = function(func,obj) { | var change = function(func,obj) { | ||
var t = obj.value; | var t = obj.value; | ||
− | if (t=='sin') { func = function(x) { return Math.sin(x); } | + | if (t=='sin') { func = function(x) { return Math.sin(x); } |
− | else if (t=='cos') { func = function(x) { return Math.cos(x); } | + | } else if (t=='cos') { func = function(x) { return Math.cos(x); } |
− | else if (t=='tan') { func = function(x) { return Math.tan(x); } | + | } else if (t=='tan') { func = function(x) { return Math.tan(x); } |
− | else if (t=='square') { func = function(x) { return x*x; } | + | } else if (t=='square') { func = function(x) { return x*x; } |
− | else if (t=='sinh') { func = function(x) { return brd.sinh(x); } | + | } else if (t=='sinh') { func = function(x) { return brd.sinh(x); } |
− | else if (t=='exp') { func = function(x) { return Math.exp(x); } | + | } else if (t=='exp') { func = function(x) { return Math.exp(x); } |
− | else if (t=='asin') { func = function(x) { return Math.asin(x); } | + | } else if (t=='asin') { func = function(x) { return Math.asin(x); } |
− | else if (t=='acos') { func = function(x) { return Math.acos(x); } | + | } else if (t=='acos') { func = function(x) { return Math.acos(x); } |
− | else if (t=='atan') { func = function(x) { return Math.atan(x); } | + | } else if (t=='atan') { func = function(x) { return Math.atan(x); } |
− | else if (t=='sqrt') { func = function(x) { return Math.sqrt(x); } | + | } else if (t=='sqrt') { func = function(x) { return Math.sqrt(x); } |
− | else if (t=='asinh') { func = function(x) { return Math.log(x+Math.sqrt(1+x*x)); } | + | } else if (t=='asinh') { func = function(x) { return Math.log(x+Math.sqrt(1+x*x)); } |
− | else if (t=='log') { func = function(x) { return Math.log(x); } | + | } else if (t=='log') { func = function(x) { return Math.log(x); } |
+ | } | ||
} | } |
Revision as of 15:31, 19 June 2009