Changing Colors with Waves
✓ Published4🌍 Public
A grid of colored circles animates in a wave-like pattern, shifting between red and blue based on their size. The canvas rendering shows 40 by 30 circles, where each circle’s horizontal position and radius oscillate with sine and cosine functions over time. The code uses the Canvas API’s `getContext('2d')`, `beginPath`, `arc`, and `fill` methods, with `requestAnimationFrame` driving the continuous animation. Colors change dynamically: circles larger than a threshold appear blue, while smaller ones turn red, creating a pulsing, color-shifting visual effect.
AI-generated descriptionA grid of moving and colored circles.
From "Mathematical Patterns" tutorial given at MIT on July 28, 2013.
MIT Licensed