Turtle Graphics: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 1: Line 1:
This is a very basic implementation of turtle graphics with [http://jsxgraph.org JSXGraph].
This is a very basic implementation of turtle graphics with [http://jsxgraph.org JSXGraph].
===List of commands===
===List of commands===
There is a predefined turtle object <math>t</math>. Therefore, all commands
start with <math>t</math>, like <math>t.fd(100);</math>
* t.forward(len); or t.fd(len);
* t.forward(len); or t.fd(len);
* t.back(len); or t.bk(len);
* t.back(len); or t.bk(len);

Revision as of 16:11, 19 December 2008

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

List of commands

There is a predefined turtle object [math]\displaystyle{ t }[/math]. Therefore, all commands start with [math]\displaystyle{ t }[/math], like [math]\displaystyle{ t.fd(100); }[/math]

  • 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