<problem>
<script type="loncapa/perl">
# Enter computations here
#
# We will plot the graph of y=a sin((x-b)/2pi) by generating points
#
# The points will be stored in two arrays, @X and @Y.
#
$a = &random(2,5,0.5);
$b = &random(0,4,1);
$x_min = -8;
$x_max = 8;
$x_delta = 0.1;
for ($x = $x_min;$x<=$x_max;$x+=$x_delta) {
push (@X,$x);
push (@Y,($a*sin(($x-$b)/2*$pi)) );
}
</script>
<gnuplot font="large" width="600" samples="100" grid="on" height="300"
alttag="Sine Curve Plot" border="on" fgcolor="x000000"
align="center" bgcolor="xffffff" transparent="off">
<axis ymin="-5" ymax="5" xmin="$x_min" xmax="$x_max" color="x000000" />
<curve linestyle="linespoints" pointtype="0" color="x000000" name="Sine Curve">
<data>@X</data>
<data>@Y</data>
</curve>
</gnuplot>
<startouttext /><br />
What is the amplitude of the sine curve graphed above?
<endouttext />
<numericalresponse answer="$a">
<responseparam name="tol" type="tolerance" description="Numerical Tolerance" default="5%" />
<responseparam name="sig" type="int_range,0-16" description="Significant Figures" default="0,15" />
<textline />
</numericalresponse>
</problem>
hallmat3@msu.edu |