[system] / trunk / webwork-modperl / doc / parser / problems / sample11.pg Repository:
ViewVC logotype

Diff of /trunk/webwork-modperl/doc/parser/problems/sample11.pg

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2612 Revision 2613
13 13
14TEXT(beginproblem()); 14TEXT(beginproblem());
15 15
16########################################################## 16##########################################################
17# 17#
18# Use Vector context 18# The setup
19# 19#
20 20
21Context('Vector'); 21Context('Interval');
22 22
23$P1 = Point(1,random(-3,3,1),random(-3,3,1)); 23$p1 = random(-5,2,1);
24$P2 = Point(random(-3,3,1),4,random(-3,3,1)); 24$p2 = random($p1+1,$p1+7,1);
25 25
26$V = Vector($P2-$P1); 26$f = Formula("x^2 - ($p1+$p2) x + $p1*$p2")->reduce;
27 27$I = Interval("($p1,$p2)");
28Context()->flags->set(ijk=>0);
29Context()->constants->add(a=>1,b=>1,c=>1);
30
31$ABC = Formula("<a,b,c>");
32 28
33########################################################## 29##########################################################
34# 30#
35# The problem text 31# The problem text
36# 32#
37 33
34Context()->texStrings;
38BEGIN_TEXT 35BEGIN_TEXT
39The vector from \(\{$P1->TeX\}\) to \(\{$P2->TeX\}\) is \{ans_rule(20)\}. 36The function \(f(x) = $f\) is negative for values of \(x\) in the interval
40$PAR 37\{ans_rule(20)\}.
41You can use either \(\{$ABC->TeX\}\) or \(\{$ABC->ijk\}\) notation,$BR
42and can perform vector operations to produce your answer.
43END_TEXT 38END_TEXT
39Context()->normalStrings;
44 40
45########################################################### 41###########################################################
46# 42#
47# The answer 43# The answer
48# 44#
49 45
50ANS($V->cmp(promotePoints=>1)); 46ANS($I->cmp);
51 47
52########################################################### 48###########################################################
53 49
54ENDDOCUMENT(); # This should be the last executable line in the problem. 50ENDDOCUMENT(); # This should be the last executable line in the problem.

Legend:
Removed from v.2612  
changed lines
  Added in v.2613

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9