diff --git a/art/lines+circles-yutaro/lines+circles.js b/art/lines+circles-yutaro/lines+circles.js new file mode 100644 index 000000000..04f96bd8e --- /dev/null +++ b/art/lines+circles-yutaro/lines+circles.js @@ -0,0 +1,57 @@ +// welcome to blot! + +const width = 125; +const height = 125; + +setDocDimensions(width, height); + +const c = 3.1; +let radius = 60; +let divisions = 60; +let divAngle = 2*Math.PI/divisions; + +function mathf(x){ + return x*c; +} + +class vec{ + constructor(x,y){ + this.x = x; + this.y = y; + } +} + +function divPos(num){ + let x = Math.cos(divAngle*num)*radius; + let y = Math.sin(divAngle*num)*radius; + return new vec(x,y); +} + +function line(turtle,startx, starty, endx, endy){ + turtle.jump([startx,starty]); + turtle.goTo([endx,endy]); +} + +const testTurtle = createTurtle(); + +for (let i = 0; i < divisions; i++) { + let x = i; + let y = mathf(x); + let startPos = divPos(x); + let endPos = divPos(y); + line(testTurtle,startPos.x,startPos.y,endPos.x,endPos.y); +} + + + +testTurtle.translate( + [width/2, height/2], + testTurtle.cc +); + +testTurtle.jump(testTurtle.ct); +testTurtle.arc(360,radius); + +drawTurtles([ + testTurtle +]); \ No newline at end of file diff --git a/art/lines+circles-yutaro/snapshots/s1.png b/art/lines+circles-yutaro/snapshots/s1.png new file mode 100644 index 000000000..15e2f2401 Binary files /dev/null and b/art/lines+circles-yutaro/snapshots/s1.png differ diff --git a/art/lines+circles-yutaro/snapshots/s2.png b/art/lines+circles-yutaro/snapshots/s2.png new file mode 100644 index 000000000..4a1149afd Binary files /dev/null and b/art/lines+circles-yutaro/snapshots/s2.png differ diff --git a/art/lines+circles-yutaro/snapshots/s3.png b/art/lines+circles-yutaro/snapshots/s3.png new file mode 100644 index 000000000..43ae74351 Binary files /dev/null and b/art/lines+circles-yutaro/snapshots/s3.png differ