[npl] / trunk / NationalProblemLibrary / Rochester / setVectors2DotProduct / UR_VC_1_13.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/Rochester/setVectors2DotProduct/UR_VC_1_13.pg

Wed Oct 17 17:35:27 2012 UTC (7 months ago) by jj
File size: 1254 byte(s)
Took pairs of problems which were exact duplicates except for their tags,
merged tags, and made one point to the other.


    1 ## DESCRIPTION
2 ##   Angle between Vectors
3 ## ENDDESCRIPTION
4
5 ## Tagged by nhamblet
6
7 ## DBsubject('Calculus')
8 ## DBchapter('Vectors and the Geometry of Space')
9 ## DBsection('The Dot Product')
10 ## Date('6/3/2002')
11 ## TitleText1('Calculus: Early Transcendentals')
12 ## AuthorText1('Rogawski')
13 ## EditionText1('1')
14 ## Section1('12.3')
15 ## Problem1('28')
16 ## TitleText2('Calculus: Early Transcendentals')
17 ## AuthorText2('Stewart')
18 ## EditionText2('6')
19 ## Section2('12.3')
20 ## Problem2('28')
21 ## KEYWORDS('Dot Product', 'Angle',"vector')
22
23 DOCUMENT();
24
26 "PG.pl",
27 "PGbasicmacros.pl",
28 "PGchoicemacros.pl",
30 "PGauxiliaryFunctions.pl"
31 );
32
33 TEXT(beginproblem());
34 $showPartialCorrectAnswers = 1; 35 36$a = non_zero_random(-10, 10);
37 $b = random(-10, 10); 38$c = random(-10, 10);
39 $d = non_zero_random(-10, 10); 40$e = random(-10, 10);
41 $f = random(-10, 10); 42 43$adbecf = $a*$d + $b*$e + $c*$f;
44
45 $dist1 = sqrt(($a)**2 + ($b)**2 + ($c)**2);
46 $dist2 = sqrt(($d)**2 + ($e)**2 + ($f)**2);
47
48 $ans = arccos($adbecf/($dist1*$dist2));
49
50 BEGIN_TEXT
51 $PAR 52 What is the angle in radians between the vectors 53$BR $${\mathbf a}$$ = ($a,$b, $c) 54 and$BR $${\mathbf b}$$ = ($d,$e, $f)? 55 56$PAR Angle: \{ ans_rule(60) \} (radians)
57 END_TEXT
58 ANS(num_cmp(\$ans));
59
60 ENDDOCUMENT();