Netlogo: How do you find the distance in a straight line?

93 Views Asked by At

I know that distance measures the distance in a radius, but how can you find the distance between a turtle and a patch that is directly in front of them (the patch can change depending on which patch you are looking at) Thanks

1

There are 1 best solutions below

0
On

Can you explain a little more what you mean? Does the distance primitive not get what you're after? For example:

to setup
  ca
  crt 1
  reset-ticks
end

to go
  ask turtles [
    rt random 60 - 30 
    fd 1
    ; Show the distance to the center of 
    ; the patch that is 3 patches away
    print distance patch-ahead 3
  ]
end