version 1.71, 2011/11/18 17:44:07
|
version 1.72, 2011/11/18 18:02:04
|
Line 402 sub plotobject_script {
|
Line 402 sub plotobject_script {
|
# |
# |
|
|
sub plotvector_script { |
sub plotvector_script { |
my ($id,$label,$xs,$ys,$xe,$ye)=@_; |
my ($id,$label,$xs,$ys,$xe,$ye,$xmin,$xmax)=@_; |
unless ($label) { |
unless ($label) { |
$Apache::functionplotresponse::counter++; |
$Apache::functionplotresponse::counter++; |
$label='V'.$Apache::functionplotresponse::counter; |
$label='V'.$Apache::functionplotresponse::counter; |
Line 410 sub plotvector_script {
|
Line 410 sub plotvector_script {
|
my $startlabel=$label.'Start'; |
my $startlabel=$label.'Start'; |
my $endlabel=$label.'End'; |
my $endlabel=$label.'End'; |
my $pointlabel=$label.'Point'; |
my $pointlabel=$label.'Point'; |
|
my $pointx=2.*($xmax-$xmin)+$xmax; |
my $anglelabel=$label.'Angle'; |
my $anglelabel=$label.'Angle'; |
return(<<ENDVECTOR); |
return(<<ENDVECTOR); |
document.ggbApplet_$id.evalCommand("$startlabel=($xs,$ys)"); |
document.ggbApplet_$id.evalCommand("$startlabel=($xs,$ys)"); |
Line 420 document.ggbApplet_$id.setLabelVisible("
|
Line 421 document.ggbApplet_$id.setLabelVisible("
|
document.ggbApplet_$id.evalCommand("$label=Vector[$startlabel,$endlabel]"); |
document.ggbApplet_$id.evalCommand("$label=Vector[$startlabel,$endlabel]"); |
document.ggbApplet_$id.setLabelVisible("$label",true); |
document.ggbApplet_$id.setLabelVisible("$label",true); |
document.ggbApplet_$id.setLineThickness("$label",8); |
document.ggbApplet_$id.setLineThickness("$label",8); |
// Displays the Angle |
document.ggbApplet_$id.evalCommand("$pointlabel=($pointx,y($startlabel))"); |
//document.ggbApplet1.evalCommand("Gravitypoint=(110,y(Gravitystart))"); //The x-value for this should be 2*(xmax-xmin)+xmax; |
document.ggbApplet_$id.evalCommand("$anglelabel=Angle[$pointlabel,$startlabel,$endlabel]"); |
//document.ggbApplet1.evalCommand("GravityAngle=Angle[Gravitypoint,Gravitystart,Gravityend]"); |
document.ggbApplet_$id.setLabelVisible("$anglelabel",true); |
//document.ggbApplet1.setLabelVisible("GravityAngle",true); |
document.ggbApplet_$id.setLabelStyle("$anglelabel",VALUE=2); |
//document.ggbApplet1.setLabelStyle("GravityAngle",VALUE=2); |
|
// Keeps track of points we care about (This should use the same listener function we use in graph problems) |
// Keeps track of points we care about (This should use the same listener function we use in graph problems) |
//document.ggbApplet1.registerObjectUpdateListener('Gravitystart','updatePointCoordinates'); |
//document.ggbApplet1.registerObjectUpdateListener('Gravitystart','updatePointCoordinates'); |
//document.ggbApplet1.registerObjectUpdateListener('Gravityend','updatePointCoordinates'); |
//document.ggbApplet1.registerObjectUpdateListener('Gravityend','updatePointCoordinates'); |
Line 553 sub start_plotvector {
|
Line 553 sub start_plotvector {
|
unless (defined($taily)) { $taily=$ymin; } |
unless (defined($taily)) { $taily=$ymin; } |
unless (defined($tipx)) { $tipx=$xmin; } |
unless (defined($tipx)) { $tipx=$xmin; } |
unless (defined($tipy)) { $tipy=$ymin; } |
unless (defined($tipy)) { $tipy=$ymin; } |
$result.=&plotvector_script($internalid,$label,$tailx,$taily,$tipx,$tipy); |
$result.=&plotvector_script($internalid,$label,$tailx,$taily,$tipx,$tipy,$xmin,$xmax); |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result=&Apache::edit::tag_start($target,$token,'Plot Vector'). |
$result=&Apache::edit::tag_start($target,$token,'Plot Vector'). |
&Apache::edit::text_arg('Label on Plot:','label', |
&Apache::edit::text_arg('Label on Plot:','label', |