const borderSize = 23.4; // min=0.1, max=50, step=0.1
const middleSize = 27.7; // min=0.1, max=100, step=0.1
const amplitude = 1.8; // min=-100, max=100, step=0.1
const width = 95; // min=10, max=200, step=1
const depthness = 1.42; // min=0.1, max=3, step=0.01
const factor = 1.43; // min=0.01, max=2, step=0.01
const startX = -47.5; // min=-100, max=100, step=0.1
const startY = -7.1; // min=-100, max=100, step=0.1

Canvas.setpenopacity(1);

const turtle = new Turtle();
turtle.penup();

const frequency = depthness / width;
const iterations = Math.PI / frequency;
const stepSize = width / iterations;

drawSineCircle(iterations, frequency, amplitude, startX, startY, stepSize, borderSize, middleSize);
drawSineCircle(iterations, frequency, amplitude * factor, startX, startY, stepSize, borderSize * factor, middleSize * factor);
drawSineCircle(iterations, frequency, amplitude * factor * factor, startX, startY, stepSize, borderSize * factor * factor, middleSize * factor * factor);

function drawSineCircle(iterations, frequency, amplitude, startX, startY, stepSize, borderSize, middleSize) {
    turtle.goto(startX+borderSize, startY);
    turtle.pendown();
    for(let i = 0; i < iterations; i += 0.1) {
        const t = i / iterations;
        const currentSize = borderSize + (middleSize - borderSize) * Math.sin(t * Math.PI);
        const y = startY + Math.sin(i) * currentSize + Math.sin(3*Math.sin(3*Math.sin(i*frequency)))*amplitude;
        const x = startX + Math.cos(i) * currentSize + i * stepSize;
        turtle.goto(x, y);
    }
    turtle.penup();
}