Interactive JessieScript: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) (New page: <jsxgraph width="600" height="450" box="box"> var board, construction = []; board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true}); s...) |
No edit summary |
||
(13 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<jsxgraph width="600" height="450" box="box"> | <jsxgraph width="600" height="450" box="box"> | ||
var board, construction = []; | var board, construction = []; | ||
board = JXG.JSXGraph.initBoard('box', {grid: | board = JXG.JSXGraph.initBoard('box', {grid:false, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true}); | ||
function construct() { | function construct() { | ||
var t = document.getElementById('input').value; | var t = document.getElementById('input').value; | ||
board.suspendUpdate(); | |||
construction.push(board.construct(t)); | construction.push(board.construct(t)); | ||
board.unsuspendUpdate(); | |||
} | } | ||
function clearAll() { | |||
JXG.JSXGraph.freeBoard(board); | |||
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true}); | |||
} | |||
</jsxgraph> | |||
< | <br> | ||
<html> | <html> | ||
<form><textarea id="input" cols= | <form><textarea id="input" cols=50 rows=4> | ||
A(1,1);B(2,2.5);C(1,3 | A(1,1);B(2,2.5);C(1,3);[AB];k(B,[AC]); | ||
</textarea> | </textarea> | ||
<br> | <br> | ||
<input type="button" value="set" onClick="construct()"> | <input type="button" value="set" onClick="construct()"> | ||
<input type="button" value="clear all" onClick="clearAll()"> | |||
</form> | </form> | ||
</html> | </html> | ||
===Available commands=== | |||
See our [http://jsxgraph.uni-bayreuth.de/wp/documentation/ documentation page] for a list of commands. | |||
==The JavaScript code== | |||
<source lang="javascript"> | |||
var board, construction = []; | |||
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true}); | |||
function construct() { | |||
var t = document.getElementById('input').value; | |||
board.suspendUpdate(); | |||
construction.push(board.construct(t)); | |||
board.unsuspendUpdate(); | |||
} | |||
function clearAll() { | |||
JXG.JSXGraph.freeBoard(board); | |||
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true}); | |||
} | |||
</source> | |||
[[Category:Geometry]] | |||
[[Category:Examples]] |
Revision as of 07:48, 8 June 2011
Available commands
See our documentation page for a list of commands.
The JavaScript code
var board, construction = [];
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});
function construct() {
var t = document.getElementById('input').value;
board.suspendUpdate();
construction.push(board.construct(t));
board.unsuspendUpdate();
}
function clearAll() {
JXG.JSXGraph.freeBoard(board);
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});
}