[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

Sat Sep 8 05:17:01 2007 UTC (5 years, 8 months ago) by sh002i
File size: 1262 byte(s)
Added tags for Rogawski's "Calculus: Early Transcendentals".


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