|
|
| (Der Versionsvergleich bezieht 93 dazwischenliegende Versionen mit ein.) |
| Zeile 1: |
Zeile 1: |
| - | <painting width=500 height=456>Name der Zeichnung</painting> | + | <jsxgraph box="jxgbox" width="500" height="500"> |
| | | | |
| | + | var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-100,100,100,-100], axis:true}); |
| | | | |
| - | <jsxgraph box="box" width="600" height="600">
| + | var r=5; |
| - | var board = JXG.JSXGraph.initBoard('box', {boundingbox: [-10, 10, 10, -10], axis:true});
| + | var p0; |
| | + | var p0=board.create('point', [0.0, 60.0],{size:5}); |
| | | | |
| - | // Create the two tanks
| + | var c0=board.create('circle', [p0, r], {visible:false}); |
| - | var tank1 = board.create('circle', [[-5, 0], 1], {fillcolor: '#8bc34a', strokecolor: 'black', name: 'Tank 1'});
| + | |
| - | var tank2 = board.create('circle', [[5, 0], 1], {fillcolor: '#8bc34a', strokecolor: 'black', name: 'Tank 2'});
| + | |
| | | | |
| - | // Create the connecting pipe
| |
| - | var pipe = board.create('line', [tank1, tank2], {strokecolor: 'black', strokewidth: 2});
| |
| | | | |
| - | // Create the heat exchanger
| + | for (let i = 0; i < 100; i++) { |
| - | var exchanger = board.create('polygon', [[-2, 2], [-2, -2], [2, -2], [2, 2]], {fillcolor: '#2196f3', strokecolor: 'black', name: 'Heat exchanger'});
| + | |
| | | | |
| - | // Create the heat flow arrow
| + | var lx0=p0.X()-Math.sin((80-i*4)*Math.PI/180)*r; |
| - | var arrow = board.create('arrow', [[-3, 3], [3, -3]], {strokecolor: 'red', strokewidth: 2, withLabel: true, name: 'Heat flow'});
| + | var ly0=p0.Y()-Math.cos((80-i*4)*Math.PI/180)*r; |
| | + | var lx1=p0.X()-Math.sin((20-i*4)*Math.PI/180)*r; |
| | + | var ly1=p0.Y()-Math.cos((20-i*4)*Math.PI/180)*r; |
| | + | var p0 = board.create('glider', [lx0, ly0,c0], { name: '1', withLabel: false, size:5, fillColor:"blue"}); |
| | + | var p1 = board.create('glider', [lx1, ly1,c0], { name: '1', withLabel: false, size:3}); |
| | | | |
| - | // Create the temperature labels
| + | var c0=board.create('circle', [p0, r], {visible:false}); |
| - | var temp1 = board.create('text', [-5, -2, 'Temp 1'], {fontsize: 18});
| + | |
| - | var temp2 = board.create('text', [5, -2, 'Temp 2'], {fontsize: 18});
| + | |
| | | | |
| - | // Create the temperature sensors
| + | } |
| - | var sensor1 = board.create('point', [-5, 2], {visible: false});
| + | |
| - | var sensor2 = board.create('point', [5, 2], {visible: false});
| + | |
| | | | |
| - | // Create the temperature meters
| |
| - | var meter1 = board.create('meter', [[-7, 2], [-7, 0], [-5, 0], [-5, 2]], {value: 50, label: 'Temp 1'});
| |
| - | var meter2 = board.create('meter', [[7, 2], [7, 0], [5, 0], [5, 2]], {value: 50, label: 'Temp 2'});
| |
| - |
| |
| - | // Create the temperature controller
| |
| - | var controller = board.create('slider', [[0, -8], [8, -8], [0, 0, 100]], {name: 'Controller'});
| |
| - | controller.on('drag', function() {
| |
| - | // Update the temperature meters
| |
| - | var temp1 = meter1.Value() + (controller.Value() - meter2.Value()) / 10;
| |
| - | var temp2 = meter2.Value() + (controller.Value() - meter1.Value()) / 10;
| |
| - | }
| |
| | </jsxgraph> | | </jsxgraph> |