Report the coordinates of the patches at the given distances and directions from the agents.

patchDistDir(world, agents, dist, angle, torus = FALSE)

# S4 method for worldNLR,matrix,numeric,numeric
patchDistDir(world, agents, dist,
angle, torus = FALSE)

## Arguments

world WorldMatrix or worldArray object. Matrix (ncol = 2) with the first column "pxcor" and the second column "pycor" representing the patches coordinates, or AgentMatrix object representing the moving agents. Numeric. Vector of distances from the agents. Must be of length 1 or of the same length as the number of agents. Numeric. Absolute directions from the agents. angle must be of length 1 or of the same length as the number of agents. Angles are in degrees with 0 being North. Logical to determine if the world is wrapped. Default is torus = FALSE.

## Value

Matrix (ncol = 2) with the first column "pxcor" and the second column "pycor" representing the coordinates of the patches at the distances dist and directions angle of agents. The order of the patches follows the order of the agents.

## Details

If torus = FALSE and the patch at distance dist and direction angle of an agent is outside the world's extent, NA are returned for the patch coordinates. If torus = TRUE, the patch coordinates from a wrapped world are returned.

If agents are turtles, their headings are not taken into account; the given directions angle are used. To find a patch at certain distance from a turtle using the turtle's heading, look at pacthAhead(), patchLeft() or patchRight().

## References

Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.

w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
p2 <- patchDistDir(world = w1, agents = t1, dist = 1, angle = 45)