This is a really interesting question. I think that the zig-zag is the optimal geometry because this is the path that light would take if both boundaries were mirrors. The slight overlap in area is made up for by the increased efficiency in spanning the square, when walking at an angle to the edge.
While writing R code, we might, therefore want to choose incident angle as the variable that determines the % coverage. Larger the incident angle, less the coverage of space and shorter the path. Here is a sample code using the library gpclib:
#Assume the field is a square of side 100 m.
library(gpclib)
i<-seq(5, 90, 5) #set up a range of angles of incidence
inc<-i[3] #demonstrating for a single angle of incidence
#can loop later and plot the relationship with area
y_inc<- sin(pi*inc/180)*100 #The y increment at each limb of the zig-zag
starts<-seq(0, 110, y_inc) #set up the list of y-values at the start of each limb
plot(0, xlim=c(0,100), ylim=c(0,100), type="n", xlab=NA, ylab=NA)
xvals<-cbind(c(0,0,100,100), c(100,100,0,0))
all_poly<-as(cbind(c(0,0),c(0,0)), "gpc.poly")
for(j in 1:(length(starts))){
if (j%%2==0) { #to decide whether to pick forward or reverse x-axis
x_poly<-xvals[,2]
}
else x_poly<-xvals[,1]
polygon(x_poly, c(starts[j]-10, starts[j]+10, #plot each polygon
starts[j+1]+10, starts[j+1]-10), col=rgb(1,0,0,0.5))
poly<-as(cbind(x_poly, c(starts[j]-10, starts[j]+10, starts[j+1]+10, starts[j+1]-10)), "gpc.poly")
all_poly<-union(all_poly, poly) #make a gpc.poly object, calculate union with other polygons
}
perc_area<-area.poly(all_poly)/100 #% area covered in this path
It uses a for loop and therefore, is probably not the most efficient way to do this. But it works! For study design, one could do this over a range of incident angles, plot it against %area covered, fit a curve to the function and find the angles of incidence that lead to 10%, 30% etc of coverage.
But thanks to this question, I did go down a rabbit hole to discover packing problems.
Also, I'd like to read the spiral solution - although it might be impractical for a field study. :)