Learn R Programming

NetLogoR (version 1.0.5)

right: Rotate to the right

Description

Rotate the turtles's headings to the right of angle degrees.

Usage

right(turtles, angle)

# S4 method for agentMatrix,numeric right(turtles, angle)

Value

AgentMatrix representing the turtles with updated heading values.

Arguments

turtles

AgentMatrix object representing the moving agents.

angle

Numeric. Vector of angles in degrees by which to rotate the turtles' headings. Must be of length 1 or of length turtles.

Author

Sarah Bauduin

Details

If a given angle value is negative, then the turtle rotates to the left.

References

Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.

See Also

Examples

Run this code
w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4)
t1 <- createTurtles(n = 10, world = w1)
of(agents = t1, var = "heading")
t1 <- right(turtles = t1, angle = 180)
of(agents = t1, var = "heading")

Run the code above in your browser using DataLab