Skip to content

Commit

Permalink
Merge pull request #231 from yutarour/main
Browse files Browse the repository at this point in the history
added lines+circles
  • Loading branch information
leomcelroy authored Jan 3, 2024
2 parents e6f3e6c + 982ce3d commit ef69d86
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions art/lines+circles-yutaro/lines+circles.js
Original file line number Diff line number Diff line change
@@ -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
]);
Binary file added art/lines+circles-yutaro/snapshots/s1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/lines+circles-yutaro/snapshots/s2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/lines+circles-yutaro/snapshots/s3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit ef69d86

@vercel
Copy link

@vercel vercel bot commented on ef69d86 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blot – ./astro

blot-git-main.hackclub.dev
blot.hackclub.dev

Please sign in to comment.