wrap_position.Rd
Wrap Position Around Grid Boundaries (Torus Topology)
wrap_position(pos, n)
Integer vector of length 2 (row, col).
Integer. Grid size.
Integer vector of length 2 with wrapped coordinates.
wrap_position(c(0, 5), 10) # c(10, 5) #> [1] 10 5 wrap_position(c(11, 5), 10) # c(1, 5) #> [1] 1 5 wrap_position(c(5, 0), 10) # c(5, 10) #> [1] 5 10