From 70f72123c319fde4a6f88ff05fb27dbd5b321837 Mon Sep 17 00:00:00 2001 From: Lev Date: Thu, 15 Jul 2021 23:11:08 -0500 Subject: [PATCH] Update spinning circle --- .../8.1.6 Circle in Polar Coords/sketcho.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 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 3857305..997defe 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 @@ -9,14 +9,11 @@ function draw() background(0); translate(width/2, height/2); let radius = 200; + let theta = frameCount; fill(255); - - for(let theta=0; theta < 360; theta += 20) - { - let x = cos(theta) * radius; - let y = sin(theta) * radius; - //let x = cos(radians(theta)) * radius; - //let y = sin(radians(theta)) * radius; - ellipse(x, y, 15, 15); - } + let x = cos(theta) * radius; + let y = sin(theta) * radius; + //let x = cos(radians(theta)) * radius; + //let y = sin(radians(theta)) * radius; + ellipse(x, y, 15, 15); }