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.

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] 188.826877 162.959399 157.782258 165.783573  66.170838   6.769842
#>  [7]  19.513974 170.246159 162.430852 176.166869
t1 <- left(turtles = t1, angle = 180)
of(agents = t1, var = "heading")
#>  [1]   8.826877 342.959399 337.782258 345.783573 246.170838 186.769842
#>  [7] 199.513974 350.246159 342.430852 356.166869