From: W. Trevor King Date: Wed, 11 Apr 2012 22:03:19 +0000 (-0400) Subject: Update MetaPost to Asymptote in Serway and Jewett v4's problem 19.15. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=efa35f22e883069e0823ab59f80a4b395485935f;p=course.git Update MetaPost to Asymptote in Serway and Jewett v4's problem 19.15. --- diff --git a/latex/problems/Serway_and_Jewett_4/problem19.15.tex b/latex/problems/Serway_and_Jewett_4/problem19.15.tex index e927f4a..1e2156f 100644 --- a/latex/problems/Serway_and_Jewett_4/problem19.15.tex +++ b/latex/problems/Serway_and_Jewett_4/problem19.15.tex @@ -6,49 +6,42 @@ at the location of charge $q_4$. \Part{b} What is the resultant force on $q_4$? \end{problem*} % problem 19.15 -\empaddtoprelude{ - numeric a; - pair A, B, C, D; - a := 1cm; - A := (0, a); % q1, labeled CCW from upper left - B := origin; % q2 - C := (a, 0); % q3 - D := (a, a); % q4 - def drawE = - label.lft("a", draw_length(A, B, 8pt)); - label.bot("a", draw_length(B, C, 8pt)); - labeloffset := 5pt; - draw_pcharge(A, 3pt); - label.bot(btex $q_1$ etex, A); - draw_pcharge(B, 3pt); - label.top(btex $q_2$ etex, B); - draw_pcharge(C, 3pt); - label.top(btex $q_3$ etex, C); - draw_pcharge(D, 3pt); - label.bot(btex $q_4$ etex, D); - enddef; -} \begin{nosolution} \begin{center} -\begin{empfile}[5ns] -\begin{emp}(0cm,0cm) - drawE; -\end{emp} -\end{empfile} +\begin{asy} +import ElectroMag; + +real u = 2cm; +draw(scale(u)*unitsquare, dashed); +Charge a = aCharge((0, u), q=2, Label("$q_1$", align=W)); a.draw(); +Charge b = aCharge((0, 0), q=3, Label("$q_2$", align=W)); b.draw(); +Charge c = aCharge((u, 0), q=4, Label("$q_3$", align=E)); c.draw(); +Charge d = aCharge((u, u), q=4, Label("$q_4$", align=E)); d.draw(); +label("$a$", (u/2, 0), align=S); +\end{asy} \end{center} \end{nosolution} \begin{solution} \begin{center} -\begin{empfile}[5] -\begin{emp}(0cm,0cm) - label.rt(btex $E_{14}$ etex, draw_Efield(A, D, 0.5cm)); - label.urt(btex $E_{24}$ etex, draw_Efield(B, D, 0.53cm)); - label.lft(btex $E_{34}$ etex, draw_Efield(C, D, 1cm)); - draw_ijhats((-1.5*a, a/3), 0, a/3); - drawE; -\end{emp} -\end{empfile} +\begin{asy} +import ElectroMag; + +real u = 2cm; +draw(scale(u)*unitsquare, dashed); +Charge a = aCharge((0, u), q=2, Label("$q_1$", align=W)); a.draw(); +Charge b = aCharge((0, 0), q=3, Label("$q_2$", align=W)); b.draw(); +Charge c = aCharge((u, 0), q=4, Label("$q_3$", align=E)); c.draw(); +Charge d = aCharge((u, u), q=1, Label("$q_4$", align=SE)); d.draw(); +label("$a$", (u/2, 0), align=S); +Charge cs[] = {a, b, c}; +CoulombEFields(d.center(), cs, scale=u, unit=u/4); +Vector F = CoulombForce(a, d, scale=u, unit=u/4) + + CoulombForce(b, d, scale=u, unit=u/4) + + CoulombForce(c, d, scale=u, unit=u/4); +F.label = Label("$F$", position=EndPoint, align=RightSide); +F.draw(); +\end{asy} \end{center} Let \ihat\ point to the right and \jhat\ point up. \begin{equation}