An accidental result while copying equations to draw with turtle.
It feels like the spiral in horror manga by Junji Ito :en.wikipedia.org/wiki/uzumaki
Log in to post a comment.
// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(1);
// Global code will be evaluated once.
const turtle = new Turtle();
const xfreq=2;
const xphrase=0.5; //min=0 max=1 step=0.1
const damping=0.01; //min=0.01 max=0.1 step=0.01
const yfreq=-2;
const yphrase=0.7; //min=0.1 max=1 step=0.1
const iteration=10000;
turtle.penup();
turtle.goto(getxcoor(0),getycoor(0));
turtle.pendown();
function getxcoor(t){
var x;
x = Math.sin(t*xfreq)*(-1*damping*t);
return x;
}
function getycoor(t){
y = Math.sin(yfreq*(t+yphrase))*(-1*damping*t);
return y;
}
// The walk function will be called until it returns false.
function walk(i) {
var time=i*10;
turtle.goto(getxcoor(time),getycoor(time));
return i+1 < iteration;
}