[npl] / trunk / NationalProblemLibrary / Rochester / setVectors2DotProduct / UR_VC_1_13.pg Repository:
ViewVC logotype

Annotation of /trunk/NationalProblemLibrary/Rochester/setVectors2DotProduct/UR_VC_1_13.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3115 - (view) (download)

1 : jjholt 205 ## DESCRIPTION
2 :     ## Angle between Vectors
3 :     ## ENDDESCRIPTION
4 : jj 140
5 : jjholt 205 ## Tagged by nhamblet
6 : jj 140
7 : jjholt 205 ## DBsubject('Calculus')
8 :     ## DBchapter('Vectors and the Geometry of Space')
9 :     ## DBsection('The Dot Product')
10 : jj 3115 ## Date('6/3/2002')
11 :     ## TitleText1('Calculus: Early Transcendentals')
12 :     ## AuthorText1('Rogawski')
13 :     ## EditionText1('1')
14 :     ## Section1('12.3')
15 :     ## Problem1('28')
16 : sh002i 556 ## TitleText2('Calculus: Early Transcendentals')
17 : jj 3115 ## AuthorText2('Stewart')
18 :     ## EditionText2('6')
19 : sh002i 556 ## Section2('12.3')
20 :     ## Problem2('28')
21 : jj 3115 ## KEYWORDS('Dot Product', 'Angle',"vector')
22 : jjholt 205
23 : jj 140 DOCUMENT();
24 :    
25 :     loadMacros(
26 :     "PG.pl",
27 :     "PGbasicmacros.pl",
28 :     "PGchoicemacros.pl",
29 :     "PGanswermacros.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 : jjholt 482 $BR \( {\mathbf a} \) = ($a, $b, $c)
54 :     and $BR \( {\mathbf b} \) = ($d, $e, $f)?
55 : jj 140
56 :     $PAR Angle: \{ ans_rule(60) \} (radians)
57 :     END_TEXT
58 :     ANS(num_cmp($ans));
59 :    
60 :     ENDDOCUMENT();

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9