version 1.7, 2010/10/05 01:28:00
|
version 1.8, 2010/10/08 23:26:04
|
Line 228 sub generate_spline {
|
Line 228 sub generate_spline {
|
my @coords=(); |
my @coords=(); |
foreach my $i (1..$order) { |
foreach my $i (1..$order) { |
$result.=&new_coordinate($id,$label.'P'.$i,$x,$y); |
$result.=&new_coordinate($id,$label.'P'.$i,$x,$y); |
$x+=$sx/$order; |
$x+=$sx/(2.*($order-1)); |
push(@coords,$label.'P'.$i); |
push(@coords,$label.'P'.$i); |
$result.=&new_coordinate($id,$label.'S'.$i,$x,$y+$sy); |
$result.=&new_coordinate($id,$label.'S'.$i,$x,$y+$sy); |
$x+=$sx/$order; |
$x+=$sx/(2.*($order-1)); |
push(@coords,$label.'S'.$i); |
push(@coords,$label.'S'.$i); |
} |
} |
$result.='document.ggbApplet_'.$id.'.evalCommand("Spline'.$order.'['.join(',',@coords).']");'."\n"; |
$result.='document.ggbApplet_'.$id.'.evalCommand("Spline'.$order.'['.join(',',@coords).']");'."\n"; |
Line 270 sub start_spline {
|
Line 270 sub start_spline {
|
unless ($label) { $label='S'.$Apache::functionplotresponse::counter; } |
unless ($label) { $label='S'.$Apache::functionplotresponse::counter; } |
|
|
my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval); |
my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval); |
if (($order<2) || ($order>4)) { $order=2; } |
if ($order<2) { $order=2; } |
|
if ($order>8) { $order=8; } |
$Apache::functionplotresponse::splineorder{$label}=$order; |
$Apache::functionplotresponse::splineorder{$label}=$order; |
|
|
my $x=&Apache::lonxml::get_param('initx',$parstack,$safeeval); |
my $x=&Apache::lonxml::get_param('initx',$parstack,$safeeval); |