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

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

Thu Jul 19 14:16:05 2007 UTC (5 years, 10 months ago) by jjholt
File size: 987 byte(s)
Updated tags.


    1 ## DESCRIPTION
2 ##   Scale a Vector
3 ## ENDDESCRIPTION
4
5 ## KEYWORDS('Scale', 'Unit', 'Vector')
6 ## Tagged by nhamblet
7
8 ## DBsubject('Calculus')
9 ## DBchapter('Vectors and the Geometry of Space')
10 ## DBsection('Vectors')
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
37 $dist = sqrt(($a)**2 + ($b)**2 + ($c)**2);
38
39 BEGIN_TEXT
40 $PAR 41 Find a unit vector in the same direction as $${\mathbf a}$$ = ($a, $b,$c).
42 $PAR 43 (\{ ans_rule(40) \}, 44 END_TEXT 45 ANS(num_cmp($a/$dist)); 46 47 BEGIN_TEXT 48 \{ ans_rule(40) \}, 49 END_TEXT 50 ANS(num_cmp($b/$dist)); 51 52 BEGIN_TEXT 53 \{ ans_rule(40) \}) 54 END_TEXT 55 ANS(num_cmp($c/\$dist));
56
57 ENDDOCUMENT();