Test
Aus Wiki1
(Unterschied zwischen Versionen)
| (Der Versionsvergleich bezieht 4 dazwischenliegende Versionen mit ein.) | |||
| 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 116: | Zeile 116: | ||
() => l1*Math.sin(theta1), | () => l1*Math.sin(theta1), | ||
() => -l1*Math.cos(theta1) | () => -l1*Math.cos(theta1) | ||
| - | ], {size: | + | ], {size:2, name:'', color:'red'}); |
let p2 = brd.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: | + | ], {size:2, name:'', fillColor: 'rgba(255, 0, 0, 0.5)', trace:true}); |
// Verbindungen | // Verbindungen | ||
| Zeile 128: | Zeile 128: | ||
// Animation | // Animation | ||
function step() { | function step() { | ||
| - | rk4(0. | + | rk4(0.01); |
| - | + | brd.update(); | |
requestAnimationFrame(step); | requestAnimationFrame(step); | ||
} | } | ||
step(); | step(); | ||
</jsxgraph> | </jsxgraph> | ||
Aktuelle Version vom 11:23, 5. Sep. 2025
