Power functions: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 4: | Line 4: | ||
var n = b.create('slider',[[-5,-2],[5,-2],[-5,1,5]],{name:'n'}); | var n = b.create('slider',[[-5,-2],[5,-2],[-5,1,5]],{name:'n'}); | ||
var m = b.create('slider',[[1,-4],[10,-4],[1,1,10]],{name:'m'}); | var m = b.create('slider',[[1,-4],[10,-4],[1,1,10]],{name:'m'}); | ||
b.create('functiongraph', [function(t){ return | b.create('functiongraph', [function(t){ return JXG.Math.pow(t,n.Value()/m.Value()); }],{strokeColor:'#ff0000'}); | ||
b.create('text',[-5, 3, function(){ return 'y=x<sup>'+(n.Value()/m.Value()).toFixed(3)+'</sup>';}]); | b.create('text',[-5, 3, function(){ return 'y=x<sup>'+(n.Value()/m.Value()).toFixed(3)+'</sup>';}]); | ||
b.unsuspendUpdate(); | b.unsuspendUpdate(); | ||
Line 15: | Line 15: | ||
var n = b.create('slider',[[-5,-2],[5,-2],[-5,1,5]],{name:'n'}); | var n = b.create('slider',[[-5,-2],[5,-2],[-5,1,5]],{name:'n'}); | ||
var m = b.create('slider',[[1,-4],[10,-4],[1,1,10]],{name:'m'}); | var m = b.create('slider',[[1,-4],[10,-4],[1,1,10]],{name:'m'}); | ||
b.create('functiongraph', [function(t){ return | b.create('functiongraph', [function(t){ return JXG.Math.pow(t,n.Value()/m.Value()); }],{strokeColor:'#ff0000'}); | ||
b.create('text',[-5, 3, function(){ return 'y=x<sup>'+(n.Value()/m.Value()).toFixed(3)+'</sup>';}]); | b.create('text',[-5, 3, function(){ return 'y=x<sup>'+(n.Value()/m.Value()).toFixed(3)+'</sup>';}]); | ||
b.unsuspendUpdate(); | b.unsuspendUpdate(); |
Latest revision as of 15:43, 20 February 2013
</html>
b = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox: [-15, 10, 15, -10]});
b.suspendUpdate();
var n = b.create('slider',[[-5,-2],[5,-2],[-5,1,5]],{name:'n'});
var m = b.create('slider',[[1,-4],[10,-4],[1,1,10]],{name:'m'});
b.create('functiongraph', [function(t){ return JXG.Math.pow(t,n.Value()/m.Value()); }],{strokeColor:'#ff0000'});
b.create('text',[-5, 3, function(){ return 'y=x<sup>'+(n.Value()/m.Value()).toFixed(3)+'</sup>';}]);
b.unsuspendUpdate();