Power functions: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 5: Line 5:
<div id="jxgbox" class="jxgbox" style="width:600px; height:400px;"></div>
<div id="jxgbox" class="jxgbox" style="width:600px; height:400px;"></div>
<script language="JavaScript">
<script language="JavaScript">
// Board
b = JXG.JSXGraph.initBoard('jxgbox', {originX: 300, originY: 200, unitX: 20, unitY: 20});
b = JXG.JSXGraph.initBoard('jxgbox', {originX: 300, originY: 200, unitX: 20, unitY: 20});
b.suspendUpdate();
b.suspendUpdate();
Line 19: Line 18:
</html>
</html>


 
<source lang="javascript">
b = JXG.JSXGraph.initBoard('jxgbox', {originX: 300, originY: 200, unitX: 20, unitY: 20});
b.createElement('axis', [[0,0], [1,0]], {});
b.createElement('axis', [[0,0], [0,1]], {});
var n = b.createElement('slider',[-5,-2,10,-5,5,0],{name:'n'});
var m = b.createElement('slider',[1.0,-4,9,1,10,1],{name:'m'});
b.createElement('curve', [function(t){ return t; }, function(t){ return b.pow(t,n.X()/m.X()); }, "t"],{strokeColor:'#ff0000'});
b.createElement('text',[-5, 3, function(){ return 'x^'+b.round(n.X()/m.X(),3);}]);
</source>
[[Category:Examples]]
[[Category:Examples]]

Revision as of 12:13, 15 December 2008

b = JXG.JSXGraph.initBoard('jxgbox', {originX: 300, originY: 200, unitX: 20, unitY: 20});
b.createElement('axis', [[0,0], [1,0]], {});
b.createElement('axis', [[0,0], [0,1]], {});
var n = b.createElement('slider',[-5,-2,10,-5,5,0],{name:'n'});
var m = b.createElement('slider',[1.0,-4,9,1,10,1],{name:'m'});
b.createElement('curve', [function(t){ return t; }, function(t){ return b.pow(t,n.X()/m.X()); }, "t"],{strokeColor:'#ff0000'});
b.createElement('text',[-5, 3, function(){ return 'x^'+b.round(n.X()/m.X(),3);}]);