[npl] / trunk / NationalProblemLibrary / ASU-topics / setTrigGraphs / p9.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

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

Tue Aug 8 13:51:04 2006 UTC (6 years, 9 months ago) by jj
File size: 1950 byte(s)
Tag fixing; precalculus --> trigonometry


    1 ## DESCRIPTION
2 ## Precalculus: Trigonometry
3 ## ENDDESCRIPTION
4
5 ## KEYWORDS('precalculus','trigonometric graphs')
6 ## Tagged by cmd6a 6/21/06
7
8 ## DBsubject('Trigonometry')
9 ## DBchapter('Trigonometry Functions of Real Numbers')
10 ## DBsection('Trigonometric Graphs')
11 ## Date('')
12 ## Author('')
13 ## Institution('ASU')
14 ## TitleText1('')
15 ## EditionText1('')
16 ## AuthorText1('')
17 ## Section1('')
18 ## Problem1('')
19
20 DOCUMENT();        # This should be the first executable line in the problem.
21
23 "PG.pl",
24 "PGbasicmacros.pl",
25 "PGchoicemacros.pl",
27 "PGauxiliaryFunctions.pl",
28 "PGgraphmacros.pl",
29 "PGasu.pl"
30 );
31
32 TEXT(beginproblem());
33
34
35 $a=random(-4, -1); 36$c=random(3,7,2);
37
38 $b=1/$c;
39 $h_shift=random(1,$c-1);
40
41 $x1dom=2*$c+$h_shift; 42$x2dom=2*$c-$h_shift;
43 $ydom=abs($a)+1;
44 $xgrid=$x1dom+$x2dom; 45$ygrid=2*$ydom; 46 47$graph = init_graph(-$x1dom,-$ydom,$x2dom,$ydom,'axes'=>[0,0],'grid'=>[$xgrid,$ygrid]);
48 $f = FEQ("$a*cos((pi/$c)*(x-$h_shift)) for x in <-$x1dom,$x2dom> using color:blue and weight:2");
49 ($fref) = plot_functions($graph, $f); 50$period = 2*$c; 51 52 # Label some points 53 #$label1 = new Label(0,$a, "$a",'black','right');
54 #$label2 = new Label($period, 0, "($period,0)",'black','left'); 55 #$d = -$a; 56 #$label3 = new Label(0,$d,"$d",'black','right');
57 #$graph->lb($label1, $label2,$label3);
58
59 $val=$h_shift-$period; 60 61 BEGIN_TEXT 62 \{ image(insertGraph($graph)) \} $PAR 63 To get a better look at the graph, you can click on it. 64$PAR
65 The curve above is the graph of a sinusoidal function.  It goes through
66 the points $$(val,a)$$ and $$(h_shift,a)$$.
67 Find a sinusoidal function that matches the given graph. If needed, you can enter
68 $$\pi$$=3.1416...  as 'pi' in your answer, otherwise use at least 3 decimal digits.
69 $PAR 70 $$f(x) =$$ \{ans_rule(60)\} 71 END_TEXT 72 73$ans = "$a*cos((pi/$c)*(x-$h_shift))"; 74 75 ANS(fun_cmp($ans, limits=>[-$x1dom,$x2dom], vars=>"x"));
76
77 ENDDOCUMENT();        # This should be the last executable line in the problem.