N-gones: Difference between revisions

From JSXGraph Wiki
(New page: <html> <link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" /> <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/pro...)
 
No edit summary
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<html>
<html>
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
<form><textarea id="inputtext" rows=12 cols=35 wrap="off" style="width:600px;">
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/prototype.js"></script>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxturtle.js"></script>
<form><textarea id="inputtext" rows=3 cols=35 wrap="off" style="width:600px;">
function n_eck(ne,sz) {
function n_eck(ne,sz) {
   for(var i=0;i<ne;i++) {
   for(var i=0;i<ne;i++) {
Line 19: Line 15:
}
}


t.cs();
t.setProperty({strokeWidth:4,strokeOpacity:0.6,fillOpacity:0.3});
t.hideTurtle();
mn_eck(36,20);
mn_eck(36,20);
</textarea><br />
</textarea><br />
Line 26: Line 25:
</html>
</html>
===Output===
===Output===
<html>
 
<div id="box" class="jxgbox" style="width:600px; height:600px;"></div>
<jsxgraph box="box" width="600" height="600">
<script language="JavaScript">
var brd = JXG.JSXGraph.initBoard('box', {boundingbox: [-300, 300, 300, -300]});
var brd = JXG.JSXGraph.initBoard('box', {originX: 300, originY: 300, unitX: 1, unitY: 1});
var t = brd.create('turtle',[],{fillColor:'yellow'});
var t = new JSXTurtleObj(brd);
function run() {
function run() {
   brd.suspendUpdate();
   brd.suspendUpdate();
   var code = $('inputtext').value;
   var code = document.getElementById('inputtext').value;
   if (code=='') { return; }
   if (code=='') { return; }
   eval(code);
   eval(code);
Line 41: Line 39:
   t.cs();
   t.cs();
}
}
</script>
run();
</html>
</jsxgraph>
===Log window===
 
<html>
* [[Slow version]]
<pre id="logwindow" class="javascript javascript" style="font-family:monospace;"></pre>
 
</html>
===References===
This example is from
* [http://de.wikipedia.org/wiki/Logo_(Programmiersprache) http://de.wikipedia.org/wiki/Logo_(Programmiersprache)]


[[Category:Examples]]
[[Category:Examples]]
[[Category:Turtle Graphics]]
[[Category:Turtle Graphics]]

Latest revision as of 09:13, 6 August 2015


Output

References

This example is from