[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 205 - (view) (download)

1 : jjholt 205 ## DESCRIPTION
2 :     ## Angle between Vectors
3 :     ## ENDDESCRIPTION
4 : jj 140
5 : jjholt 205 ## KEYWORDS('Dot Product', 'Angle')
6 :     ## Tagged by nhamblet
7 : jj 140
8 : jjholt 205 ## 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 : jj 140 DOCUMENT();
21 :    
22 :     loadMacros(
23 :     "PG.pl",
24 :     "PGbasicmacros.pl",
25 :     "PGchoicemacros.pl",
26 :     "PGanswermacros.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();

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9