TurtleGraphics - Online Manual

turtle_turn {TurtleGraphics}R Documentation

Turn (Rotate) the Turtle

Description

Turn the Turtle in the given direction by the given angle.

Usage

turtle_turn(angle, direction = c("left", "right"))

turtle_left(angle)

turtle_right(angle)

Arguments

angle

single numeric value; rotation angle in degrees. A negative value turns the Turtle in the opposite direction than the given one.

direction

character string; direction of the turn. Possible values are "left" and "right".

Details

The Turtle must be initialized prior to using this function, see turtle_init.

See Also

Other TurtleGraphics: TurtleGraphics-package; turtle_backward, turtle_forward, turtle_move; turtle_col, turtle_lty, turtle_lwd, turtle_param; turtle_down, turtle_up; turtle_do; turtle_getangle, turtle_getpos; turtle_goto, turtle_setangle, turtle_setpos; turtle_hide, turtle_show; turtle_init; turtle_reset; turtle_status

Examples

turtle_init()
turtle_left(30) # equivalent to turtle_turn(30, "left")
turtle_right(40)
turtle_turn(30, sample(c("left", "right"), 1)) # random turn

[Package TurtleGraphics version 1.0-5 Index]