Qubitalent

Qubitalent's logo

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();
turtle.radians();

// The walk function will be called until it returns false.
function walk(i) {
    Reuleaux(120, 0, 70);
return false;
}

function Reuleaux(size, x, y){
    turtle.jump(x, y);
    Reuleaux1(100, turtle.x(), turtle.y());
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI));
    turtle.circle(-size, Math.PI /3);
    Reuleaux2(100, turtle.x(), turtle.y());
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI + (Math.PI * 2/3)));
    turtle.circle(-size, Math.PI /3);
    Reuleaux3(100, turtle.x(), turtle.y());
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI + (Math.PI * 4/3)));
    turtle.circle(-size, Math.PI /3);
}

function Reuleaux1(size, x, y){
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI));
    turtle.circle(-size, Math.PI /3);
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI + (Math.PI * 2/3)));
    turtle.circle(-size, 0.885*Math.PI /3);
    turtle.jump(x, y);
}

function Reuleaux2(size, x, y){
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI + (Math.PI * 2/3)));
    turtle.circle(-size, Math.PI /3);
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI + (Math.PI * 4/3)));
    turtle.circle(-size, 0.885*Math.PI /3);
    turtle.jump(x, y);
}

function Reuleaux3(size, x, y){
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI + (Math.PI * 4/3)));
    turtle.circle(-size, Math.PI /3);
    turtle.seth(-(Math.sin(Math.PI / 6) + 2*Math.PI));
    turtle.circle(-size, 0.885*Math.PI /3);
    turtle.jump(x, y);
}