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

left(turtles, angle)

# S4 method for agentMatrix,numeric
left(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 right.

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] 293.76909 327.47305 216.89974 47.45606 304.43503 271.16782 262.97351 #> [8] 97.46880 145.94206 130.83462
t1 <- left(turtles = t1, angle = 180) of(agents = t1, var = "heading")
#> [1] 113.76909 147.47305 36.89974 227.45606 124.43503 91.16782 82.97351 #> [8] 277.46880 325.94206 310.83462