Download NetLogo 5.1.0 User Manual - Center for Connected Learning and
Transcript
NetLogo 5.1.0 User Manual If the caller is the observer, then the points are measured relative to the origin, in other words, the points are taken as absolute patch coordinates. If the caller is a turtle, the points are measured relative to the turtle's exact location, and not from the center of the patch under the turtle. ask turtles at-points [[2 4] [1 2] [10 15]] [ fd 1 ] ;; only the turtles on the patches at the ;; distances (2,4), (1,2) and (10,15), ;; relative to the caller, move atan atan x y Converts x and y offsets to a turtle heading in degrees (from 0 to 360). Note that this version of atan is designed to conform to the geometry of the NetLogo world, where a heading of 0 is straight up, 90 is to the right, and so on clockwise around the circle. (Normally in geometry an angle of 0 is right, 90 is up, and so on, counterclockwise around the circle, and atan would be defined accordingly.) When y is 0: if x is positive, it reports 90; if x is negative, it reports 270; if x is zero, you get an error. show atan 1 -1 => 135 show atan -1 1 => 315 crt 1 [ set heading 30 => 30 fd 1 print atan xcor ycor ] In the final example, note that the result of atan equals the turtle's heading. If you ever need to convert a turtle heading (obtained with atan or otherwise) to a normal mathematical angle, the following should be helpful: to-report heading-to-angle [ h ] report (90 - h) mod 360 end autoplot? autoplot? Reports true if auto-plotting is on for the current plot, false otherwise. auto-plot-off auto-plot-on NetLogo Dictionary 323
Related documents
NetLogo 4.1.2 User Manual - Center for Human Science
NetLogo 4.1.3 User Manual - Center for Connected Learning and
NetLogo 4.0.5 User Manual - Center for Connected Learning and
NetLogo 2.0.2 User Manual - Center for Connected Learning and
NetLogo 4.0 User Manual - scstevenson
NetLogo 3.1.4 User Manual
NetLogo 3.0 User Manual
NetLogo 1.1 User Manual
Introduction to NetLogo Outline
NetLogo 2.1.0 User Manual
NetLogo Implementation of Evacuation Scenario
Netlogo!