[npl] / trunk / NationalProblemLibrary / ASU-topics / setTrigGraphs / p23.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/ASU-topics/setTrigGraphs/p23.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 297 - (download) (annotate)
Wed Jun 28 22:52:53 2006 UTC (6 years, 10 months ago) by jj
File size: 1951 byte(s)
Fixed some tags.

    1 ## DESCRIPTION
    2 ## Geometry: Plane Geometry
    3 ## ENDDESCRIPTION
    4 
    5 ## KEYWORDS('geometry', 'plane')
    6 ## Tagged by YJ
    7 
    8 ## DBsubject('Trigonometry')
    9 ## DBchapter('Plane Geometry')
   10 ## DBsection('Trigonometric Functions')
   11 ## Date('5/26/2005')
   12 ## Author('Jeff Holt')
   13 ## Institution('UVA')
   14 ## TitleText1('Calculus')
   15 ## EditionText1('5e')
   16 ## AuthorText1('Stewart')
   17 ## Section1('5.8.2')
   18 ## Problem1(' ')
   19 
   20 DOCUMENT();        # This should be the first executable line in the problem.
   21 
   22 loadMacros(
   23 "PG.pl",
   24 "PGbasicmacros.pl",
   25 "PGanswermacros.pl",
   26 "PGauxiliaryFunctions.pl",
   27 "PGgraphmacros.pl",
   28 "PGasu.pl"
   29 );
   30 
   31 TEXT(beginproblem());
   32 
   33 $a=random(-4, -1);
   34 
   35 $c=random(1, 8);
   36 $b=1/$c;
   37 $pi=4*arctan(1);
   38 $xdom=3*$c;
   39 $ydom=abs($a)+1;
   40 $xgrid=2*$xdom;
   41 $ygrid=2*$ydom;
   42 $graph = init_graph(-$xdom,-$ydom,$xdom,$ydom,'axes'=>[0,0],'grid'=>[$xgrid,$ygrid]);
   43 $f = FEQ("$a*cos($pi*$b*x) for x in <-$xdom,$xdom> using color:blue and weight:2");
   44 ($fref) = plot_functions( $graph, $f);
   45 $period = 2*$c;
   46 
   47 # Label some points
   48 $label1 = new Label(0,$a, "$a",'black','right');
   49 $d = -$a;
   50 $label2 = new Label($c, $d, "($c,$d)",'black','bottom','center');
   51 $label3 = new Label(0,$d,"$d",'black','top');
   52 $graph->lb($label1, $label2, $label3);
   53 
   54 
   55 BEGIN_TEXT
   56 \{ image(insertGraph($graph)) \} $BR$BR
   57 To get a better look at the graph, you can click on it.
   58 $BR$BR
   59 
   60 The curve above is the graph of a sinusoidal function.  It goes through
   61 the point \( ($c,$d) \).
   62 Find a sinusoidal function that matches the given graph. If needed, you can enter
   63 \(\pi\)  as $BITALIC pi$EITALIC in your answer.
   64 $BR$BR
   65 \(f(x) = \) \{ans_rule(60)\}
   66 END_TEXT
   67 
   68 #
   69 # Tell WeBWork how to test if answers are right.  These should come in the
   70 # same order as the answer blanks above.  You tell WeBWork both the type of
   71 # "answer evaluator" to use, and the correct answer.
   72 #
   73 $ans = "$a*cos(pi*x/$c)";
   74 
   75 ANS(fun_cmp($ans,limits=>[[-$xdom,$xdom]]));
   76 
   77 ENDDOCUMENT();        # This should be the last executable line in the problem.
   78 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9