|
|
Line 134: |
Line 134: |
| return (a.Value()*Math.cos(2*Math.PI*b.Value()*x-2*Math.PI*c.Value()/360)+d.Value()*Math.cos(2*Math.PI*e.Value()*x-2*Math.PI*g.Value()/360)) | | return (a.Value()*Math.cos(2*Math.PI*b.Value()*x-2*Math.PI*c.Value()/360)+d.Value()*Math.cos(2*Math.PI*e.Value()*x-2*Math.PI*g.Value()/360)) |
| }], {strokeColor: "red"}); | | }], {strokeColor: "red"}); |
− |
| |
− | //Definition des Punktes p_T0, des Hilfspunktes p_T0h und der Geraden l_T0 für Periodendauer T_0
| |
− | p_T0=brd1.create('point', [function(){ return Math.round(getT0() *100)/100;},
| |
− | function(){ return a.Value()*Math.cos(2*Math.PI*b.Value()*(Math.round(getT0() *100)/100)-2*Math.PI*c.Value()/360)
| |
− | +d.Value()*Math.cos(2*Math.PI*e.Value()*(Math.round(getT0() *100)/100)-2*Math.PI*g.Value()/360);}], {color:"blue", fixed:true, label:false, size:1, name:''})
| |
− | p_T0h = brd1.create('point', [function(){ return Math.round(getT0() *100)/100;}, 2], {visible: false, color:"blue", fixed:true, label:false, size:1, name:''})
| |
− | l_T0 = brd1.create('line', [p_T0, p_T0h])
| |
− |
| |
− | //Bestimmung des Wertes T_0 mit der Funktion von Siebenwirth
| |
− | setInterval(function() {
| |
− | var y=Math.round(getT0() *100)/100
| |
− | document.getElementById("T_0").innerHTML = b.Value();
| |
− | MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
| |
− | }, 0.1);
| |
− |
| |
− | function getT0() {
| |
− |
| |
− | var A, B, C, Q;
| |
− | if (b.Value() < e.Value()) {
| |
− | A = b.Value();
| |
− | B = e.Value();
| |
− | } else {
| |
− | B = b.Value();
| |
− | A = e.Value();
| |
− | }
| |
− |
| |
− | console.log('Berechne T0 mit A=' + A, 'B=' + B);
| |
− |
| |
− | for (var x = 1; x <= 100; x++) {
| |
− | C = A / x;
| |
− | Q = B / C;
| |
− | console.log(x + '. Durchgang: C = ' + C, 'Q = ' + Q);
| |
− | if (isInt(Q)) {
| |
− | console.log('Q ist eine Qanzzahl!!! T0 ist damit ', 1 / C);
| |
− | return 1 / C;
| |
− | }
| |
− | if (x === 10) {
| |
− | return 10;
| |
− | }
| |
− | if ((1/C) > 10)
| |
− | return 10
| |
− | }
| |
− | }
| |
− |
| |
− | function isInt(n) {
| |
− | return n % 1 === 0;
| |
− | }
| |
− |
| |
− | //Ausgabe des Wertes x(t)
| |
− | setInterval(function() {
| |
− | document.getElementById("x(t)").innerHTML=Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*t.Value()-2*Math.PI*c.Value()/360)+d.Value()*Math.cos(2*Math.PI*e.Value()*t.Value()-2*Math.PI*g.Value()/360))*1000)/1000;
| |
− | }, 0.1);
| |
− |
| |
− | //Ausgabe des Wertes x(t+T_0)
| |
− | setInterval(function() {
| |
− | document.getElementById("x(t+T_0)").innerHTML = Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*(t.Value()+Math.round(getT0() *1000)/1000)-c.Value())+d.Value()*Math.cos(2*Math.PI*e.Value()*(t.Value()+Math.round(getT0() *1000)/1000)-g.Value()))*1000)/1000;
| |
− | }, 0.1);
| |
− |
| |
− | //Ausgabe des Wertes x(t+2T_0)
| |
− | setInterval(function() {
| |
− | document.getElementById("x(t+2T_0)").innerHTML = Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*(t.Value()+2*Math.round(getT0() *1000)/1000)-c.Value())+d.Value()*Math.cos(2*Math.PI*e.Value()*(t.Value()+2*Math.round(getT0() *1000)/1000)-g.Value()))*1000)/1000;
| |
− | }, 0.1);
| |
− |
| |
− | //Ausgabe des Wertes x_max
| |
− | setInterval(function() {
| |
− | var x = new Array(50000);
| |
− | for (var i = 0; i < 50001; i++) {
| |
− | x[i] = Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*(i/1000)-2*Math.PI*c.Value()/360)+d.Value()*Math.cos(2*Math.PI*e.Value()*(i/1000)-2*Math.PI*g.Value()/360)) *1000)/1000;
| |
− | }
| |
− | document.getElementById("x_max").innerHTML = Math.max.apply(Math, x);
| |
− | }, 0.1);
| |
| | | |
| //Definition der Funktion zum An- und Ausschalten des Koordinatengitters | | //Definition der Funktion zum An- und Ausschalten des Koordinatengitters |
Line 220: |
Line 149: |
| </form> | | </form> |
| | | |
− | <script>
| |
| | | |
− | //Definition des Reset-Buttons
| |
− | function zurueck() {
| |
− | document.getElementById("myForm").reset();
| |
− | };
| |
− | </script>
| |
| | | |
| </body> | | </body> |