[Chaos_Dotter] Use requestAnimationFrame, batch points per frame, responsive canvas

Open
#399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
css, html, javascript

Research direction

Start with Math_Chaos/Chaos_Dotter/index.html at the listed lines and trace the timer callback, canvas setup, and colorCircle calls. Check how the page currently sizes and redraws the canvas before changing the animation loop. Done means a recognizable Sierpinski triangle appears within one second and the page is usable at 375 px width.

Written by the indexing model from the issue text.

Description

area: math-chaos priority: P3 size: M type: enhancement

Summary

The demo plots one point per timer tick and redraws every polygon vertex each tick, so the fractal takes minutes to appear. The page also has min-width: 820px and a fixed 800x600 canvas, so it does not work well on phones.

Location

  • Math_Chaos/Chaos_Dotter/index.html:12-14
  • Math_Chaos/Chaos_Dotter/index.html:48
  • Math_Chaos/Chaos_Dotter/index.html:143-165

Evidence

One colorCircle(centerX, centerY, 1) per tick, plus N vertex circles redrawn per tick.

Expected

Thousands of points appear per frame, and vertices are drawn once. Optional extras: rules such as "no vertex twice in a row", a reset button, and PNG export.

Proposed fix

  1. Use requestAnimationFrame and plot, for example, 2,000 points per frame into an ImageData buffer.
  2. Draw vertices once on restart.
  3. Make the canvas size follow the container (devicePixelRatio-aware).
  4. Add restricted-choice variants (e.g. “cannot pick the previous vertex”, which gives interesting patterns for n=4).

Acceptance criteria

  • A Sierpinski triangle is recognizable within 1 s
  • Page is usable at 375 px width

Repository audit, November 2026 · Phase 9 · New features · evidence: found by code reading · ref chaos-native-029


Generated by Claude Code

Dominant language
C++
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ibra-kdbra/Math-Problems

All issues in ibra-kdbra/Math-Problems

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.