Test

Aus Wiki1

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
 
(Der Versionsvergleich bezieht 5 dazwischenliegende Versionen mit ein.)
Zeile 50: Zeile 50:
<jsxgraph box="box" width="500" height="500">
<jsxgraph box="box" width="500" height="500">
-
         var board = JXG.JSXGraph.initBoard('box', {boundingbox: [-3,3,3,-3], axis:true});
+
         var brd = JXG.JSXGraph.initBoard('box', {boundingbox: [-3,3,3,-3], axis:true});
     // Parameter
     // Parameter
Zeile 58: Zeile 58:
     // Anfangsbedingungen (Winkel in Radiant)
     // Anfangsbedingungen (Winkel in Radiant)
-
     let theta1 = Math.PI/2;    // oberes Pendel
+
     let theta1 = 0.1*Math.PI/2;    // oberes Pendel
-
     let theta2 = Math.PI/4;    // unteres Pendel
+
     let theta2 = 0.1*Math.PI/4;    // unteres Pendel
     let omega1 = 0;            // Winkelgeschwindigkeit 1
     let omega1 = 0;            // Winkelgeschwindigkeit 1
     let omega2 = 0;            // Winkelgeschwindigkeit 2
     let omega2 = 0;            // Winkelgeschwindigkeit 2
Zeile 112: Zeile 112:
     // Punkte für das Pendel
     // Punkte für das Pendel
-
     let origin = board.create('point', [0,0], {fixed:true, size:2, name:''});
+
     let origin = brd.create('point', [0,0], {fixed:true, size:2, name:''});
-
     let p1 = board.create('point', [
+
     let p1 = brd.create('point', [
       () => l1*Math.sin(theta1),
       () => l1*Math.sin(theta1),
       () => -l1*Math.cos(theta1)
       () => -l1*Math.cos(theta1)
-
     ], {size:4, name:'', color:'red'});
+
     ], {size:2, name:'', color:'red'});
-
     let p2 = board.create('point', [
+
     let p2 = brd.create('point', [
       () => l1*Math.sin(theta1) + l2*Math.sin(theta2),
       () => l1*Math.sin(theta1) + l2*Math.sin(theta2),
       () => -l1*Math.cos(theta1) - l2*Math.cos(theta2)
       () => -l1*Math.cos(theta1) - l2*Math.cos(theta2)
-
     ], {size:4, name:'', color:'blue'});
+
     ], {size:2, name:'', fillColor: 'rgba(255, 0, 0, 0.5)', trace:true});
     // Verbindungen
     // Verbindungen
-
     board.create('line', [origin, p1], {straightFirst:false, straightLast:false});
+
     brd.create('line', [origin, p1], {straightFirst:false, straightLast:false});
-
     board.create('line', [p1, p2], {straightFirst:false, straightLast:false});
+
     brd.create('line', [p1, p2], {straightFirst:false, straightLast:false});
     // Animation
     // Animation
     function step() {
     function step() {
-
       rk4(0.02);
+
       rk4(0.01);
-
       board.update();
+
       brd.update();
       requestAnimationFrame(step);
       requestAnimationFrame(step);
     }
     }
     step();
     step();
</jsxgraph>
</jsxgraph>

Aktuelle Version vom 11:23, 5. Sep. 2025


Persönliche Werkzeuge