Turtle Graphics: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 10: Line 10:
* t.setPos(x,y);
* t.setPos(x,y);


===Example===
===Snowflake Example===
<html>
<html>
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
Line 36: Line 36:
     });
     });
}
}


t.clean();
t.clean();

Revision as of 16:08, 19 December 2008

This is a very basic implementation of turtle graphics with JSXGraph.

List of commands

  • t.forward(len); or t.fd(len);
  • t.back(len); or t.bk(len);
  • t.right(angle); or t.rt(angle);
  • t.left(angle); or t.lt(angle);
  • t.penUp();
  • t.penDown();
  • t.clean();
  • t.setPos(x,y);

Snowflake Example