From: W. Trevor King Date: Thu, 3 May 2012 12:26:47 +0000 (-0400) Subject: Update Young and Freedman v12 to use Circ.asy v0.2. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=befdd3f08df09d1c7bf78e059815ca871d979fe1;p=course.git Update Young and Freedman v12 to use Circ.asy v0.2. --- diff --git a/latex/problems/Young_and_Freedman_12/problem27.39.tex b/latex/problems/Young_and_Freedman_12/problem27.39.tex index ab98594..a84259f 100644 --- a/latex/problems/Young_and_Freedman_12/problem27.39.tex +++ b/latex/problems/Young_and_Freedman_12/problem27.39.tex @@ -16,18 +16,19 @@ import Circ; real supRadius = 3mm; -TwoTerminal V = source(ang=-180, type=DC, val="V"); -TwoTerminal R = resistor(V.beg, "R"); +MultiTerminal V = source(dir=-180, type=DC, label="$V$"); +MultiTerminal R = resistor(V.terminal[0], label="$R$"); +real rlen = R.terminal[1].x - R.terminal[0].x; -real lBar = 0.6*abs(R.end-V.end); +real lBar = 0.6*abs(R.terminal[1]-V.terminal[1]); real hBar = 1mm; -pair cBar = (V.end+R.end)/2 - (0,R.len); +pair cBar = (V.terminal[1]+R.terminal[1])/2 - (0,rlen); // top, left, and right points for the left support pair tLsup = cBar - (lBar/2, hBar/2); pair lLsup = tLsup + supRadius * dir(-120); pair rLsup = tLsup + supRadius * dir(-60); -wire(V.end, lLsup, udsq); +wire(V.terminal[1], lLsup, udsq); wire(lLsup, tLsup); wire(tLsup, rLsup); @@ -35,7 +36,7 @@ wire(tLsup, rLsup); pair tRsup = cBar + (lBar/2, -hBar/2); pair lRsup = tRsup + supRadius * dir(-120); pair rRsup = tRsup + supRadius * dir(-60); -wire(R.end, rRsup, udsq); +wire(R.terminal[1], rRsup, udsq); wire(rRsup, tRsup); wire(tRsup, lRsup); diff --git a/latex/problems/Young_and_Freedman_12/problem27.68.tex b/latex/problems/Young_and_Freedman_12/problem27.68.tex index 3be3fc4..783127c 100644 --- a/latex/problems/Young_and_Freedman_12/problem27.68.tex +++ b/latex/problems/Young_and_Freedman_12/problem27.68.tex @@ -11,24 +11,28 @@ import Mechanics; import ElectroMag; import Circ; -TwoTerminal Rv = resistor(ang=90, val="$10.0\U{\Ohm}$"); -TwoTerminal Rh = resistor(Rv.end, ang=-180, val="$25.0\U{\Ohm}$"); -TwoTerminal V = source(type=DC, "$120.0\U{V}$", draw=false); -centerto(Rv, V, Rh.len); V.draw(); -TwoTerminal S = switchSPST(Rv.end, type=NO, "$S$"); -wire(V.beg, (2*Rh.len, Rv.beg.y), udsq); -wire(V.end, Rh.end, udsq); -wire(S.end, (2*Rh.len, S.end.y), nsq); +MultiTerminal Rv = resistor(dir=90, + value=rotate(90)*Label("$10.0\U{\Ohm}$")); +real rlen = Rv.terminal[1].y - Rv.terminal[0].y; +MultiTerminal Rh = resistor(Rv.terminal[1], dir=-180, value="$25.0\U{\Ohm}$"); +MultiTerminal V = source(type=DC, value=Label("$120.0\U{V}$", align=W), + draw=false); +two_terminal_centerto(Rv, V, rlen); V.draw(); +MultiTerminal S = switchSPST(Rv.terminal[1], type=open, "$S$"); +wire(V.terminal[0], (2*rlen, Rv.terminal[0].y), udsq); +wire(V.terminal[1], Rh.terminal[1], udsq); +wire(S.terminal[1], (2*rlen, S.terminal[1].y), nsq); +dot(Rv.terminal[0]); -real xBar = (S.end.x+2*Rh.len)/2; +real xBar = (S.terminal[1].x+2*rlen)/2; Vector Bs[]; int i, n = 4; -real dy = 1.4*Rv.len/(n-1); -real yBstart = Rv.mid.y - (n-1)*dy/2; -real xB = xBar - Rh.len/2; +real dy = 1.4*rlen/(n-1); +real yBstart = Rv.center.y - (n-1)*dy/2; +real xB = xBar - rlen/2; for (i=0; i