## DESCRIPTION ## Angle between Vectors ## ENDDESCRIPTION ## Tagged by nhamblet ## DBsubject('Calculus') ## DBchapter('Vectors and the Geometry of Space') ## DBsection('The Dot Product') ## Date('6/3/2002') ## TitleText1('Calculus: Early Transcendentals') ## AuthorText1('Rogawski') ## EditionText1('1') ## Section1('12.3') ## Problem1('28') ## TitleText2('Calculus: Early Transcendentals') ## AuthorText2('Stewart') ## EditionText2('6') ## Section2('12.3') ## Problem2('28') ## KEYWORDS('Dot Product', 'Angle',"vector') 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 \( {\mathbf a} \) = ($a, $b, $c) and $BR \( {\mathbf b} \) = ($d, $e, $f)? $PAR Angle: \{ ans_rule(60) \} (radians) END_TEXT ANS(num_cmp($ans)); ENDDOCUMENT();