List of available commands: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 16: | Line 16: | ||
* t.setPenSize(size); (size: number) | * t.setPenSize(size); (size: number) | ||
* t.setPenColor(col); (col: colorString, e.g. 'red' or '#ff0000') | * t.setPenColor(col); (col: colorString, e.g. 'red' or '#ff0000') | ||
* t. | * t.setAttribute({key1:value1,key2:value2,...}); | ||
* t.pushTurtle() | * t.pushTurtle() | ||
* t.popTurtle() | * t.popTurtle() |
Latest revision as of 11:49, 24 March 2021
There is a predefined turtle object t. Therefore, all commands start with t, like t.fd(100);
* 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(); or t.pu();
* t.penDown(); or t.pd();
* t.clearScreen(); or t.cs();
* t.clean();
* t.setPos(x,y);
* t.home();
* t.hideTurtle(); or t.ht();
* t.showTurtle(); or t.st();
* t.setPenSize(size); (size: number)
* t.setPenColor(col); (col: colorString, e.g. 'red' or '#ff0000')
* t.setAttribute({key1:value1,key2:value2,...});
* t.pushTurtle()
* t.popTurtle()
* t.lookTo(dir) or t.lookTo([x,y]) (Turtle looks to a coordinate pair. If t2 is another turtle object: t.lookTo(t2.pos))
* t.moveTo([x,y]) (Turtle goes forward to the coordinates pair. The turtles direction is not changed.)
* t.X(), t.Y(): get the position of the turtle t.
- ) [math]\displaystyle{ {}_{\left( 0\leq angle \leq 360 \right)} }[/math]