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

Aperta
#399 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
css, html, javascript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C++
Stelle
2
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ibra-kdbra/Math-Problems

Tutte le issue di ibra-kdbra/Math-Problems

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.