Update MetaPost to Asymptote in Serway and Jewett v4's problem 19.4.
authorW. Trevor King <wking@drexel.edu>
Wed, 11 Apr 2012 18:04:49 +0000 (14:04 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 11 Apr 2012 18:05:16 +0000 (14:05 -0400)
latex/problems/Serway_and_Jewett_4/problem19.04.tex

index 95736d3c8c21a3105787c56107abdf5ec577ce54..842d7da962492dbb789d8b724973ea535b93e858 100644 (file)
@@ -6,35 +6,31 @@ and keeps the nucleus from bursting apart.  What is the magnitude of
 $F$?
 \end{problem*} % problem 19.4
 
-\empaddtoprelude{
-  pair A, B;
-  A := origin;
-  B := (3cm, 0);
-  def drawB = 
-    draw_pcharge(A, 6pt);
-    draw_pcharge(B, 6pt);
-    label.bot("r", draw_length(A, B, 10pt));
-  enddef;
-}
-
 \begin{nosolution}
 \begin{center}
-\begin{empfile}[2ns]
-\begin{emp}(0cm, 0cm)
-  drawB;
-\end{emp}
-\end{empfile}
+\begin{asy}
+import ElectroMag;
+
+real u = 0.5cm;
+Charge a = pCharge();  a.draw();
+Charge b = pCharge((3u, 0));  b.draw();
+Distance dab = Distance(a.center(), b.center(), scale=u, L="$r$");  dab.draw();
+\end{asy}
 \end{center}
 \end{nosolution}
 
 \begin{solution}
 \begin{center}
-\begin{empfile}[2]
-\begin{emp}(0cm, 0cm)
-  label.top("F", draw_force(A, B, 20pt));
-  drawB;
-\end{emp}
-\end{empfile}
+\begin{asy}
+import ElectroMag;
+
+real u = 1cm;
+Charge a = pCharge();  a.draw();
+Charge b = pCharge((1.25u, 0));  b.draw();
+Distance dab = Distance(a.center(), b.center(), scale=u, L="$r$");  dab.draw();
+Charge cs[] = {a, b};
+CoulombForces(cs, scale=u, unit=u);
+\end{asy}
 \end{center}
 
 \begin{equation}