[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 May 10 16:17:05 2006 UTC (7 years ago) by jjholt
File size: 1119 byte(s)
Added tags.


    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
20 DOCUMENT();
21
23 "PG.pl",
24 "PGbasicmacros.pl",
25 "PGchoicemacros.pl",
27 "PGauxiliaryFunctions.pl"
28 );
29
30 TEXT(beginproblem());
31 $showPartialCorrectAnswers = 1; 32 33$a = non_zero_random(-10, 10);
34 $b = random(-10, 10); 35$c = random(-10, 10);
36 $d = non_zero_random(-10, 10); 37$e = random(-10, 10);
38 $f = random(-10, 10); 39 40$adbecf = $a*$d + $b*$e + $c*$f;
41
42 $dist1 = sqrt(($a)**2 + ($b)**2 + ($c)**2);
43 $dist2 = sqrt(($d)**2 + ($e)**2 + ($f)**2);
44
45 $ans = arccos($adbecf/($dist1*$dist2));
46
47 BEGIN_TEXT
48 $PAR 49 What is the angle in radians between the vectors 50$BR $${\bf a}$$ = ($a,$b, $c) 51 and$BR $${\bf b}$$ = ($d,$e, $f)? 52 53$PAR Angle: \{ ans_rule(60) \} (radians)
54 END_TEXT
55 ANS(num_cmp(\$ans));
56
57 ENDDOCUMENT();