netlogo - Move turtles around a patch -


i trying move turtle around patch 0 0 starting random position in world. circle keeps on growing. doing wrong here?.

code:

to setup   clear-all   create-turtles 5   ask turtles [     setxy random-xcor random-ycor     ]   ask patch 0 0 [ set pcolor green ]   reset-ticks end go    move-turtles   tick end move-turtles   ask turtles   [     face patch 0 0     right 90     fd 0.01     set pen-size 3     pen-down    ] end 

secondly want turtle move around patch define when reaches in range

your approach take small step along tangent circle want, takes little bit outside circle. repeatedly, accumulates on time.

for better way, see turtles circling example in netlogo models library.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -