Description Usage Details Value See Also Examples
turtle_getpos
returns the Turtle's current position on the plane.
turtle_getangle
returns the Turtle's current direction,
in degrees. An angle of 0 represents a north-facing Turtle.
1 2 3 |
The terrarium must be initialized prior to using these functions,
see turtle_init
.
Both functions return a (named) numeric vector.
turtle_getpos
returns a vector of length two which
specifies the x
and y
coordinates.
The turtle_getangle
returns the angle.
Other TurtleGraphics: TurtleGraphics-package
,
turtle_do
, turtle_goto
,
turtle_init
, turtle_move
,
turtle_param
, turtle_reset
,
turtle_show
, turtle_status
,
turtle_turn
, turtle_up
1 2 3 | turtle_init()
turtle_getpos()["x"] # x coordinate
turtle_getpos()["y"] # y coordinate
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.