From 33e8de7f5aaf1e08f56896b1488bbfa13ae2d288 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 11 Apr 2012 14:55:03 -0400 Subject: [PATCH] Update MetaPost to Asymptote in Serway and Jewett v4's problem 19.11. --- .../Serway_and_Jewett_4/problem19.11.tex | 65 +++++++++---------- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/latex/problems/Serway_and_Jewett_4/problem19.11.tex b/latex/problems/Serway_and_Jewett_4/problem19.11.tex index 74c9518..52473bf 100644 --- a/latex/problems/Serway_and_Jewett_4/problem19.11.tex +++ b/latex/problems/Serway_and_Jewett_4/problem19.11.tex @@ -4,50 +4,43 @@ the electric field is zero. $q_1 = -2.50\U{$\mu$C}$ and $q_2 = 6.00\U{$\mu$C}$. \end{problem*} % problem 19.11 -\empaddtoprelude{ - pair A, B; - A := origin; - B := (2cm, 0); - C := (-3.6cm, 0); - numeric orig_labeloffset; - orig_labeloffset := labeloffset; - def drawD = - label.bot("x", draw_arrow((-2cm,0), (-1cm,0), 4cm, 0pt, black)); - label.bot("0", draw_ltic(A, -90, 0, 10pt, 0pt, black)); - label.bot("1m", draw_ltic(B, -90, 0, 10pt, 0pt, black)); - draw_ncharge(A, 4pt); - draw_pcharge(B, 6pt); - labeloffset := 8pt; - label.top(btex $q_1$ etex, A); - label.top(btex $q_2$ etex, B); - labeloffset := orig_labeloffset; - enddef; -} - \begin{nosolution} \begin{center} -\begin{empfile}[4ns] -\begin{emp}(0cm,0cm) - drawD; -\end{emp} -\end{empfile} +\begin{asy} +import ElectroMag; + +real u = 2cm; +draw_ijhat(); +Charge a = aCharge(q=-2.5, "$q_1$"); a.draw(); +Charge b = aCharge(q=6.0, (1u, 0), "$q_2$"); b.draw(); +Distance dab = Distance(a.center(), b.center(), offset=12pt, L="$1\U{m}$"); +dab.draw(); +\end{asy} \end{center} \end{nosolution} \begin{solution} \begin{center} -\begin{empfile}[4] -\begin{emp}(0cm,0cm) - drawD; - draw_tic(A, -180, 0, 4.5cm, 0pt, black); % extend x axis - label.top(btex $r_1$ etex, draw_length(A, C, 20pt)); - label.bot(btex $r_2$ etex, draw_length(C, B, 20pt)); - label.bot(btex $E_1$ etex, draw_Efield(A, C, -10pt)); - label.bot(btex $E_2$ etex, draw_Efield(B, C, 10pt)); - dotlabel("",C); -\end{emp} -\end{empfile} +\begin{asy} +import ElectroMag; + +real u = 2cm; +draw_ijhat(); +Charge a = aCharge(q=-2.5, "$q_1$"); a.draw(); +Charge b = aCharge(q=6.0, (1u, 0), "$q_2$"); b.draw(); +Distance dab = Distance(a.center(), b.center(), offset=12pt, L="$1\U{m}$"); +dab.draw(); +pair c = (-1.82u, 0); +Distance dac = Distance(c, a.center(), offset=24pt, L="$r_1$"); dac.draw(); +Distance dbc = Distance(c, b.center(), offset=36pt, L="$r_2$"); dbc.draw(); +Charge cs[] = {a, b}; +CoulombEFields(c, cs, scale=u, unit=u); +dot(c); +\end{asy} \end{center} +% label.bot(btex $E_1$ etex, draw_Efield(A, C, -10pt)); +% label.bot(btex $E_2$ etex, draw_Efield(B, C, 10pt)); +% dotlabel("",C); First, we need a coordinate system. Let $q_1$ be the origin ($x_1=0$), and $q_2$ be at $x_2 = 1.00\U{m}$. -- 2.26.2