Difference between revisions of "Applets:Spektrum"
From LNTwww
David.Jobst (talk | contribs) |
David.Jobst (talk | contribs) |
||
Line 103: | Line 103: | ||
//Einstellungen der Achsen | //Einstellungen der Achsen | ||
xaxis1 = pltBox1.create('axis', [[0, 0], [1,0]], { | xaxis1 = pltBox1.create('axis', [[0, 0], [1,0]], { | ||
− | name:' | + | name:'\\[t\\]', |
withLabel:true, label:{position:'rt', offset:[-25, 15]} | withLabel:true, label:{position:'rt', offset:[-25, 15]} | ||
}); | }); | ||
yaxis1 = pltBox1.create('axis', [[0, 0], [0, 1]], { | yaxis1 = pltBox1.create('axis', [[0, 0], [0, 1]], { | ||
− | name:' | + | name:'\\[x(t)\\]', |
withLabel:true, label:{position:'rt', offset:[10, -5]} | withLabel:true, label:{position:'rt', offset:[10, -5]} | ||
}); | }); | ||
xaxis2 = pltBox2.create('axis', [[0, 0], [1,0]], { | xaxis2 = pltBox2.create('axis', [[0, 0], [1,0]], { | ||
− | name:' | + | name:'\\[f\\]', |
withLabel:true, label:{position:'rt', offset:[-25, 15]} | withLabel:true, label:{position:'rt', offset:[-25, 15]} | ||
}); | }); | ||
yaxis2 = pltBox2.create('axis', [[0, 0], [0, 1]], { | yaxis2 = pltBox2.create('axis', [[0, 0], [0, 1]], { | ||
− | name:' | + | name:'\\[X(f)\\]', |
withLabel:true, label:{position:'rt', offset:[10, -5]} | withLabel:true, label:{position:'rt', offset:[10, -5]} | ||
}); | }); | ||
Line 121: | Line 121: | ||
//Festlegen der Schieberegler | //Festlegen der Schieberegler | ||
sldA1 = cnfBox1.create('slider',[[-2.8,1],[0.8,1],[0,1,2]], { | sldA1 = cnfBox1.create('slider',[[-2.8,1],[0.8,1],[0,1,2]], { | ||
− | suffixlabel:' $A_1$ | + | suffixlabel:' $A_1=$', |
snapWidth:0.05 | snapWidth:0.05 | ||
}), | }), | ||
sldDT1 = cnfBox1.create('slider',[[-2.8,0.9],[0.8,0.9],[0,1,2]], { | sldDT1 = cnfBox1.create('slider',[[-2.8,0.9],[0.8,0.9],[0,1,2]], { | ||
− | suffixlabel:' $Δt_1$ | + | suffixlabel:' $Δt_1=$', |
snapWidth:0.01 | snapWidth:0.01 | ||
}), | }), | ||
sldR1 = cnfBox1.create('slider',[[-2.8,0.8],[0.8,0.8],[0,0.5,1]], { | sldR1 = cnfBox1.create('slider',[[-2.8,0.8],[0.8,0.8],[0,0.5,1]], { | ||
− | suffixlabel:' $r_1$ | + | suffixlabel:' $r_1=$', |
snapWidth:0.05 | snapWidth:0.05 | ||
}), | }), | ||
sldA2 = cnfBox2.create('slider',[[-2.8,1],[0.8,1],[0,1,2]], { | sldA2 = cnfBox2.create('slider',[[-2.8,1],[0.8,1],[0,1,2]], { | ||
− | suffixlabel:' $A_2$ | + | suffixlabel:' $A_2=$', |
snapWidth:0.05 | snapWidth:0.05 | ||
}), | }), | ||
sldDT2 = cnfBox2.create('slider',[[-2.8,0.9],[0.8,0.9],[0,1,2]], { | sldDT2 = cnfBox2.create('slider',[[-2.8,0.9],[0.8,0.9],[0,1,2]], { | ||
− | suffixlabel:' $Δt_2$ | + | suffixlabel:' $Δt_2=$', |
snapWidth:0.05 | snapWidth:0.05 | ||
}), | }), | ||
sldR2 = cnfBox2.create('slider',[[-2.8,0.8],[0.8,0.8],[0,0.5,1]], { | sldR2 = cnfBox2.create('slider',[[-2.8,0.8],[0.8,0.8],[0,0.5,1]], { | ||
− | suffixlabel:' $r_2$ | + | suffixlabel:' $r_2=$', |
snapWidth:0.05 | snapWidth:0.05 | ||
}), | }), | ||
Line 159: | Line 159: | ||
//Definition der Texte für die Funktionswerte von Impuls 1 | //Definition der Texte für die Funktionswerte von Impuls 1 | ||
var txtG1=cnfBox1.create('text',[0,0.1, function() | var txtG1=cnfBox1.create('text',[0,0.1, function() | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA1.Value()*Math.exp(-1*Math.PI*(sldT.Value()/sldDT1.Value())*(sldT.Value()/sldDT1.Value())))*1000)/1000 +' \\]';}], |
{fixed:true, strokeColor:'red', visible:true}); | {fixed:true, strokeColor:'red', visible:true}); | ||
var txtR1=cnfBox1.create('text',[0,0.1, function(){ | var txtR1=cnfBox1.create('text',[0,0.1, function(){ | ||
if (Math.abs(sldT.Value())<sldDT1.Value()/2) | if (Math.abs(sldT.Value())<sldDT1.Value()/2) | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA1.Value())*1000)/1000 +' \\]';} |
else if(Math.abs(sldT.Value())==sldDT1.Value()/2) | else if(Math.abs(sldT.Value())==sldDT1.Value()/2) | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA1.Value()/2)*1000)/1000 +' \\]';} |
else | else | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((0)*1000)/1000 +' \\]';}}], |
{fixed:true, strokeColor:'red', visible:false}); | {fixed:true, strokeColor:'red', visible:false}); | ||
var txtD1=cnfBox1.create('text',[0,0.1, function(){ | var txtD1=cnfBox1.create('text',[0,0.1, function(){ | ||
if (Math.abs(sldT.Value())<sldDT1.Value()) | if (Math.abs(sldT.Value())<sldDT1.Value()) | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA1.Value()*(1-Math.abs(sldT.Value())/sldDT1.Value()))*1000)/1000 +' \\]';} |
else | else | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((0)*1000)/1000 +' \\]';}}], |
{fixed:true, strokeColor:'red', visible:false}); | {fixed:true, strokeColor:'red', visible:false}); | ||
var txtGS1=cnfBox1.create('text',[0,0, function() | var txtGS1=cnfBox1.create('text',[0,0, function() | ||
− | {return ' | + | {return '\\[X(f)= '+ Math.round((sldA1.Value()*sldDT1.Value()*Math.exp(-1*Math.PI*(sldF.Value()*sldDT1.Value())*(sldF.Value()*sldDT1.Value())))*1000)/1000 +' \\]' ;}], |
{fixed:true, strokeColor:'red', visible:true}); | {fixed:true, strokeColor:'red', visible:true}); | ||
var txtRS1=cnfBox1.create('text',[0,0, function() | var txtRS1=cnfBox1.create('text',[0,0, function() | ||
− | {return ' | + | {return '\\[X(f)= '+ Math.round((sldA1.Value()*sldDT1.Value()*Math.sin(Math.PI*sldDT1.Value()*sldF.Value())/(Math.PI*sldDT1.Value()*sldF.Value()))*1000)/1000 +' \\]' ;}], |
{fixed:true, strokeColor:'red', visible:false}); | {fixed:true, strokeColor:'red', visible:false}); | ||
var txtDS1=cnfBox1.create('text',[0,0, function() | var txtDS1=cnfBox1.create('text',[0,0, function() | ||
− | {return ' | + | {return '\\[X(f)= '+ Math.round((sldA1.Value()*sldDT1.Value()*Math.pow(Math.sin(Math.PI*sldDT1.Value()*sldF.Value())/(Math.PI*sldDT1.Value()*sldF.Value()),2))*1000)/1000 +' \\]' ;}], |
{fixed:true, strokeColor:'red', visible:false}); | {fixed:true, strokeColor:'red', visible:false}); | ||
Line 191: | Line 191: | ||
var txtG2=cnfBox2.create('text',[-2,0.1, function() | var txtG2=cnfBox2.create('text',[-2,0.1, function() | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA2.Value()*Math.exp(-1*Math.PI*(sldT.Value()/sldDT2.Value())*(sldT.Value()/sldDT2.Value())))*1000)/1000 +' \\]' ;}], |
{fixed:true, strokeColor:'blue', visible:false}); | {fixed:true, strokeColor:'blue', visible:false}); | ||
var txtR2=cnfBox2.create('text',[-2,0.1, function(){ | var txtR2=cnfBox2.create('text',[-2,0.1, function(){ | ||
if (Math.abs(sldT.Value())<sldDT2.Value()/2) | if (Math.abs(sldT.Value())<sldDT2.Value()/2) | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA2.Value())*1000)/1000 +' \\]';} |
else if(Math.abs(sldT.Value())==sldDT2.Value()/2) | else if(Math.abs(sldT.Value())==sldDT2.Value()/2) | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA2.Value()/2)*1000)/1000 +' \\]';} |
else | else | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((0)*1000)/1000 +' \\]';}}], |
{fixed:true, strokeColor:'blue', visible:false}); | {fixed:true, strokeColor:'blue', visible:false}); | ||
var txtD2=cnfBox2.create('text',[-2,0.1, function(){ | var txtD2=cnfBox2.create('text',[-2,0.1, function(){ | ||
if (Math.abs(sldT.Value())<sldDT2.Value()) | if (Math.abs(sldT.Value())<sldDT2.Value()) | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((sldA2.Value()*(1-Math.abs(sldT.Value())/sldDT2.Value()))*1000)/1000 +' \\]';} |
else | else | ||
− | {return ' | + | {return '\\[x(t)= '+ Math.round((0)*1000)/1000 +' \\]';}}], |
{fixed:true, strokeColor:'blue', visible:false}); | {fixed:true, strokeColor:'blue', visible:false}); | ||
var txtGS2=cnfBox2.create('text',[-2,0, function() | var txtGS2=cnfBox2.create('text',[-2,0, function() | ||
− | {return ' | + | {return '\\[X(f)= '+ Math.round((sldA2.Value()*sldDT2.Value()*Math.exp(-1*Math.PI*(sldF.Value()*sldDT2.Value())*(sldF.Value()*sldDT2.Value())))*1000)/1000 +' \\]' ;}], |
{fixed:true, strokeColor:'blue', visible:false}); | {fixed:true, strokeColor:'blue', visible:false}); | ||
var txtRS2=cnfBox2.create('text',[-2,0, function() | var txtRS2=cnfBox2.create('text',[-2,0, function() | ||
− | {return ' | + | {return '\\[X(f)= '+ Math.round((sldA2.Value()*sldDT2.Value()*Math.sin(Math.PI*sldDT2.Value()*sldF.Value())/(Math.PI*sldDT2.Value()*sldF.Value()))*1000)/1000 +' \\]' ;}], |
{fixed:true, strokeColor:'blue', visible:false}); | {fixed:true, strokeColor:'blue', visible:false}); | ||
var txtDS2=cnfBox2.create('text',[-2,0, function() | var txtDS2=cnfBox2.create('text',[-2,0, function() | ||
− | {return ' | + | {return '\\[X(f)= '+ Math.round((sldA2.Value()*sldDT2.Value()*Math.pow(Math.sin(Math.PI*sldDT2.Value()*sldF.Value())/(Math.PI*sldDT2.Value()*sldF.Value()),2))*1000)/1000 +' \\]' ;}], |
{fixed:true, strokeColor:'blue', visible:false}); | {fixed:true, strokeColor:'blue', visible:false}); | ||
Revision as of 14:33, 18 September 2017
Impuls 1
Impuls 2