ScratchData LogoScratchData
Back to crkcity's profile

Circular vs. Polygonal Archimedes spirals - recursion with very little code

CRcrkcity•Created December 18, 2022
Circular vs. Polygonal Archimedes spirals - recursion with very little code
4
3
26 views
View on Scratch

Instructions

Flag. Click "polygonal" or "circular" Archimedes spiral. "Archimedes" spiral, because evenly spaced coils. Very few blocks of recursion needed to create the pattern. Aim is to show cases of recursion using minimal code.

Description

Shows how a minimal amount of recursive code can show math patterns. Circular Archimedes spiral: sine & cosine function with radius shrinking over time by "length increment." Polygonal Archimedes spiral, the motion is a short straight path followed by a turn. The length traveled is reduced by a constant "length increment" For polygonal spiral, the length eventually goes negative, reverses direction--so the spiral goes outward instead of inward. Recursive code (code that calls itself). You can get the same result with a repeating loop like "forever." That is iteration. An iterative code is a code that uses a loop to repeat an action. Anything that can be done iteratively can be done recursively, and vice versa.

Project Details

Project ID778587997
CreatedDecember 18, 2022
Last ModifiedFebruary 1, 2023
SharedJanuary 21, 2023
Visibilityvisible
CommentsAllowed