Parent Directory
|
Revision Log
Cleaned code with convert-functions.pl script
1 ## DESCRIPTION 2 ## Multivariable Calculus 3 ## ENDDESCRIPTION 4 5 ## KEYWORDS('calculus','normal','gradient') 6 ## Tagged by cmd6a 3/12/06 7 8 ## DBsubject('Calculus') 9 ## DBchapter('Vector Calculus') 10 ## DBsection('Parametric Surfaces and Their Areas') 11 ## Date('') 12 ## Author('') 13 ## Institution('ASU') 14 ## TitleText1('') 15 ## EditionText1('') 16 ## AuthorText1('') 17 ## Section1('') 18 ## Problem1('') 19 20 DOCUMENT(); 21 loadMacros("PG.pl", 22 "PGbasicmacros.pl", 23 "PGchoicemacros.pl", 24 "PGanswermacros.pl", 25 "PGauxiliaryFunctions.pl", 26 "PGgraphmacros.pl", 27 "Dartmouthmacros.pl"); 28 29 30 ## Do NOT show partial correct answers 31 $showPartialCorrectAnswers = 1; 32 33 ## Lots of set up goes here 34 $pi = acos(-1); 35 @angles= ($pi/6, $pi/4, $pi/3); 36 @angles_print= ("\pi/6", "\pi/4", "\pi/3"); 37 38 $which_theta = NchooseK(3,1); 39 $which_phi = NchooseK(3,1); 40 $theta = $angles[$which_theta]; 41 $theta_print = $angles_print[$which_theta]; 42 $phi = $angles[$which_phi]; 43 $phi_print = $angles_print[$which_phi]; 44 $r = random(2,6,1); 45 46 47 $x0 = spf($r * cos($theta) * sin($phi),"%7.5f"); 48 $y0 = spf($r * sin($theta) * sin($phi),"%7.5f"); 49 $z0 = spf($r * cos($phi),"%7.5f"); 50 51 52 ## Ok, we are ready to begin the problem... 53 ## 54 TEXT(beginproblem()); 55 56 57 BEGIN_TEXT 58 $BR 59 A sphere of radius $r is centered at the origin. 60 $BR 61 It may be viewed as a parametrized surface: 62 \( \mathbf{r}(\theta,\phi) = ($r \cos\theta \sin\phi, $r \sin\theta \sin\phi, $r \cos\phi)\), 63 a level surface of the function \( f(x,y,z) = x^2 + y^2 + z^2 \), 64 or as the graph of the function \(g(x,y) = \sqrt{\{$r**2\} - x^2 - y^2}\). 65 $BR 66 Consider the sphere at the point \( ($x0, $y0, $z0) \) (corresponding to 67 \((\theta, \phi) = ($theta_print, $phi_print)\) ). 68 $PAR 69 $BBOLD A)$EBOLD Find the normal vector \( \mathbf{r}_\theta \times \mathbf{r}_\phi\) at the given point: $BR 70 \((\)\{ ans_rule(25)\}, \{ ans_rule(25)\},\{ ans_rule(25)\} \()\) 71 $BR 72 $BBOLD B)$EBOLD Find the gradient of \(f\) at the indicated point:$BR 73 \((\)\{ ans_rule(25)\}, \{ ans_rule(25)\},\{ ans_rule(25)\} \()\) 74 $BR 75 76 They should be parallel .... 77 $PAR 78 END_TEXT 79 80 ANS(num_cmp(-$r*sin($phi)*$x0)); 81 ANS(num_cmp(-$r*sin($phi)*$y0)); 82 ANS(num_cmp(-$r*sin($phi)*$z0)); 83 ANS(num_cmp(2 * $x0)); 84 ANS(num_cmp(2 * $y0)); 85 ANS(num_cmp(2 * $z0)); 86 87 ENDDOCUMENT(); 88 89 90 91
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |