Mandelbrot mit JSXGraph

Aus Wiki1

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
 
Zeile 20: Zeile 20:
   });
   });
-
  // Slider für Formel
 
-
  const sliderPotx = board.create('slider', [[-2.3, 1.1], [0.5, 1.1], [2, 2, 3]], {
 
-
    name:'Potenz x',
 
-
    snapWidth:0.1
 
-
  });
 
-
  // Slider für Formel
 
-
  const sliderPoty = board.create('slider', [[-2.3, 1.00], [0.5, 1.0], [2, 2, 3]], {
 
-
    name:'Potenz y',
 
-
    snapWidth:0.1
 
-
  });
 
   // Canvas ins DOM hängen
   // Canvas ins DOM hängen
   const div = document.getElementById('jxgbox');
   const div = document.getElementById('jxgbox');
Zeile 47: Zeile 37:
     while (x*x + y*y <= 4 && iter < maxIter) {
     while (x*x + y*y <= 4 && iter < maxIter) {
       const xtemp = x*x - y*y + cx;
       const xtemp = x*x - y*y + cx;
-
       y = Math.pow(x,sliderPotx.Value())*x*y + cy;
+
       y = 2*x*y + cy;
       x = xtemp;
       x = xtemp;
       iter++;
       iter++;
Zeile 102: Zeile 92:
   sliderIter.on('drag', update);
   sliderIter.on('drag', update);
   sliderZoom.on('drag', update);
   sliderZoom.on('drag', update);
-
  sliderPotx.on('drag', update);
+
 
-
  sliderPoty.on('drag', update);
+
   // Panning mit Maus
   // Panning mit Maus

Aktuelle Version vom 12:37, 26. Sep. 2025

Mit den Schiebereglern können Iterations-Tiefe und Zoom gesteuert werden. Mit der Maus+linke Maustaste kann der Bildausschnitt verschoben werden.

Persönliche Werkzeuge