Simulating a spider web
A friend shared a video of a spider making web. Found the equations for drawing different components of the web. The figure above was drawn by the following code in R. -------- # Code based on material provided by Andrew Chambers # https://ibmathsresources.com/2021/09/10/weaving-a-spider-web/ # 30 Sep 2022 graphics.off() # First make a graph paper where the web shall be drawn plot(1,1, type="n", pch=".", xlim=c(-15,15), ylim=c(-15, 15), xlab="", ylab="", axes=F) for(i in (-15):15) { if(i%%5==0) { mycol = "gray80" } else { mycol="gray90" } abline(h=i, v=i, col=mycol) } # Straight lines passing through sharp points # formula for getting the lines # Note: In the tutorial, this was drawn at the end # However it is drawn first here to make it consistent # with the video of actual spider's work today get_slope = function(p) { numr = sin(9*pi*p/5)-9*sin(pi*p/5) denr = cos(9*pi*p/5)+9*cos(pi*p...