From 2b733f856bd02790f34cb26cd63c0fa9e7d08a93 Mon Sep 17 00:00:00 2001 From: Lev Date: Thu, 15 Jul 2021 23:15:01 -0500 Subject: [PATCH] Update Archimedean spiral is complete --- .../Topic 8/8.1.6 Circle in Polar Coords/sketcho.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CM2030 Graphics Programming/Topic 8/8.1.6 Circle in Polar Coords/sketcho.js b/CM2030 Graphics Programming/Topic 8/8.1.6 Circle in Polar Coords/sketcho.js index 997defe..9c1b502 100644 --- a/CM2030 Graphics Programming/Topic 8/8.1.6 Circle in Polar Coords/sketcho.js +++ b/CM2030 Graphics Programming/Topic 8/8.1.6 Circle in Polar Coords/sketcho.js @@ -1,19 +1,21 @@ function setup() { createCanvas(500, 500); + background(0); angleMode(DEGREES); } function draw() -{ - background(0); +{ translate(width/2, height/2); - let radius = 200; let theta = frameCount; - fill(255); + let radius = frameCount/10; + let x = cos(theta) * radius; let y = sin(theta) * radius; //let x = cos(radians(theta)) * radius; //let y = sin(radians(theta)) * radius; + fill(255); + noStroke(); ellipse(x, y, 15, 15); }