version 1.6, 2010/10/05 00:10:07
|
version 1.7, 2010/10/05 01:28:00
|
Line 214 ENDPLOTSCRIPT
|
Line 214 ENDPLOTSCRIPT
|
} |
} |
|
|
# |
# |
# Subroutine that generates spline $label based on stored information |
# Subroutine that generates code for spline $label based on stored information |
# |
# |
|
|
sub generate_spline { |
sub generate_spline { |
my ($id,$label)=@_; |
my ($id,$label)=@_; |
my $result=''; |
my $result=''; |
|
my $order=$Apache::functionplotresponse::splineorder{$label}; |
|
my $x=$Apache::functionplotresponse::splineinitx{$label}; |
|
my $y=$Apache::functionplotresponse::splineinity{$label}; |
|
my $sx=$Apache::functionplotresponse::splinescalex{$label}; |
|
my $sy=$Apache::functionplotresponse::splinescaley{$label}; |
|
my @coords=(); |
|
foreach my $i (1..$order) { |
|
$result.=&new_coordinate($id,$label.'P'.$i,$x,$y); |
|
$x+=$sx/$order; |
|
push(@coords,$label.'P'.$i); |
|
$result.=&new_coordinate($id,$label.'S'.$i,$x,$y+$sy); |
|
$x+=$sx/$order; |
|
push(@coords,$label.'S'.$i); |
|
} |
|
$result.='document.ggbApplet_'.$id.'.evalCommand("Spline'.$order.'['.join(',',@coords).']");'."\n"; |
return $result; |
return $result; |
} |
} |
# |
# |
Line 273 sub start_spline {
|
Line 288 sub start_spline {
|
my $sy=&Apache::lonxml::get_param('scaley',$parstack,$safeeval); |
my $sy=&Apache::lonxml::get_param('scaley',$parstack,$safeeval); |
unless ($sy) { $sy=2; } |
unless ($sy) { $sy=2; } |
$Apache::functionplotresponse::splinescaley{$label}=$sy; |
$Apache::functionplotresponse::splinescaley{$label}=$sy; |
|
return ''; |
} |
} |
|
|
sub end_spline { |
sub end_spline { |