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

right(turtles, angle)

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

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.

Value

AgentMatrix representing the turtles with updated heading values.

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

Author

Sarah Bauduin

Examples

w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4) t1 <- createTurtles(n = 10, world = w1) of(agents = t1, var = "heading")
#> [1] 180.33821 174.98545 334.52894 91.31178 78.63714 114.83865 273.41085 #> [8] 299.75034 272.51115 230.72126
t1 <- right(turtles = t1, angle = 180) of(agents = t1, var = "heading")
#> [1] 0.3382132 354.9854477 154.5289394 271.3117818 258.6371362 294.8386510 #> [7] 93.4108498 119.7503441 92.5111526 50.7212589