Some Lissajous curves: en.wikipedia.org/wiki/lissajous_curve

Please note that some of these patterns are repeated and may cause a plotter to over right the same point multiple times. I am going to see if I can adapt this code to prevent this.

Log in to post a comment.

// Forked from "Lissajous curves" by reinder // https://turtletoy.net/turtle/982e9ce2ae // Lissajous curves. Created by Reinder Nijhoff 2018 // @reindernijhoff // // https://turtletoy.net/turtle/982e9ce2ae // Canvas.setpenopacity(.5); const div = 16; const steps = 60; const turtles = []; const s = 200; for (let x=0; x<div; x++) { for (let y=0; y<div; y++) { turtles.push(new Turtle((x + .5) * s/div - s/2, (y + .9) * s/div - s/2)); } } function walk(i) { for (let x=0; x<div; x++) { for (let y=0; y<div; y++) { turtles[y+x*div].goto( (x + .5 + .4 * Math.sin((x+1)*i*2*Math.PI/steps)) * s/div - s/2, (y + .5 + .4 * Math.cos((y+1)*i*2*Math.PI/steps)) * s/div - s/2); } } return i < steps; }