File:  [LON-CAPA] / loncom / homework / templates / functionplotback.problem
Revision 1.1: download - view: text, annotated - select for diffs
Sat Nov 13 22:30:32 2010 UTC (13 years, 6 months ago) by www
Branches: MAIN
CVS tags: HEAD
More examples
Correction for undefined upper value on boundaries

    1: <problem>
    2: <script type="loncapa/perl">$x=&random(-5,5,2);
    3: $y=&random(-3,3,2);
    4: $a=&random(0.5,0.9,0.1);
    5: if (&random(0,1,1)) {
    6:    $function="$a*(x-($x))^2+($y)";
    7:    $relation='gt';
    8: } else {
    9:    $function="-$a*(x-($x))^2+($y)";
   10:    $relation='lt';
   11: }</script>
   12: <startouttext />
   13: Provide a sketch of the derivative of the indicated function<br /> <endouttext />
   14: <functionplotresponse xaxisvisible="yes" xlabel="x" gridvisible="yes" ylabel="y(x)" id="11" xmax="10" yaxisvisible="yes" xmin="-10" ymin="-10" ymax="10">
   15: <functionplotelements>
   16: <spline initx="-4" inity="0" index="A" order="3" scalex="8" />
   17: <backgroundplot function="$function" fixed="yes" />
   18: </functionplotelements>
   19: <functionplotruleset>
   20: <functionplotrule relationship="eq" xinitial="$x" value="0" derivativeorder="0" percenterror="2" index="extreme" />
   21: <functionplotrule relationship="$relation" xinitiallabel="start" xfinallabel="end" value="0" derivativeorder="1" percenterror="10" index="slope" />
   22: <functionplotrule relationship="eq" xinitiallabel="start" xfinallabel="end" value="0" derivativeorder="2" percenterror="50" index="linear" />
   23: </functionplotruleset>
   24: </functionplotresponse>
   25: </problem>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>