Skip to content

Instantly share code, notes, and snippets.

@NuarkNoir
Created October 1, 2022 07:14
Show Gist options
  • Save NuarkNoir/39861fe763b7ccb1448408952880ed8a to your computer and use it in GitHub Desktop.
Save NuarkNoir/39861fe763b7ccb1448408952880ed8a to your computer and use it in GitHub Desktop.
let count = 5;
let magn = 200;
let levels = 8;
function setup() {
createCanvas(600, 600);
strokeWeight(1);
stroke(255, 204, 0);
noFill();
}
function draw() {
background(0);
translate(width/2, height/2);
drawWeb();
drawPoints();
}
function drawWeb() {
for (let i = 0; i < count; i++) {
let step = 2*PI / count * i;
let posX = magn * cos(step);
let posY = magn * sin(step);
line(0, 0, posX, posY);
}
for (let i = 0; i < levels+1; i++) {
let rad = magn / levels * i * 2;
ellipse(0, 0, rad, rad);
}
}
function drawPoints() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment