Skip to main content
100%

gcd-viz

✓ Published0🌍 Public
11wheel
Last edited Aug 21, 2016
Created on May 19, 2015

The visualization animates the Euclidean algorithm as it computes the greatest common divisor of two random integers, revealing the recursive subtraction steps as nested square blocks. It shows how each division step’s quotient and remainder tile a rectangle, with the final GCD emerging from the arranged squares. The code uses D3.js with SVG and transitions to fade in colored square groups sequentially, while text spans display the intermediate division equations. Random inputs are regenerated after the animation completes, looping the process. The `d3.range` and `transition.delay` orchestrate the cascading reveal, and the colors cycle through a palette per step.

AI-generated description

Similar vizzes