## DESCRIPTION ## Angle between Vectors ## ENDDESCRIPTION ## KEYWORDS('Dot Product', 'Angle') ## Tagged by nhamblet ## DBsubject('Calculus') ## DBchapter('Vectors and the Geometry of Space') ## DBsection('The Dot Product') ## Date('5/31/2000') ## Author('Joseph Neisendorfer') ## Institution('Rochester') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') DOCUMENT(); loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1;$a = non_zero_random(-10, 10); $b = random(-10, 10);$c = random(-10, 10); $d = non_zero_random(-10, 10);$e = random(-10, 10); $f = random(-10, 10);$adbecf = $a*$d + $b*$e + $c*$f; $dist1 = sqrt(($a)**2 + ($b)**2 + ($c)**2); $dist2 = sqrt(($d)**2 + ($e)**2 + ($f)**2); $ans = arccos($adbecf/($dist1*$dist2)); BEGIN_TEXT $PAR What is the angle in radians between the vectors$BR $${\bf a}$$ = ($a,$b, $c) and$BR $${\bf b}$$ = ($d,$e, $f)?$PAR Angle: \{ ans_rule(60) \} (radians) END_TEXT ANS(num_cmp(\$ans)); ENDDOCUMENT();