\begin{asy}
import Circ;
real u = 3cm;
- TwoTerminal ra = resistor((0,0), normal, 0, "$r_1 = 1.0\U{\Ohm}$", "");
- TwoTerminal Ba = source(ra.end, DC, 0, "", "$\mathcal{E}_1 = 12\U{V}$");
- TwoTerminal rb = resistor(ra.beg+(0,-u), normal, 0, "$r_2 = 2.0\U{\Ohm}$", "");
- TwoTerminal Bb = source(rb.end, DC, 0, "", "$\mathcal{E}_2 = 18\U{V}$");
- TwoTerminal R = resistor(Bb.end+(0.5u,0.25u), normal, 90, "", "$R = 6.6\U{\Ohm}$");
- wireU(rb.beg, ra.beg, -24pt, rlsq);
+ TwoTerminal ra = resistor((0,0), ang=0, "$r_1 = 1.0\U{\Ohm}$", "");
+ TwoTerminal Ba = source(
+ ra.end, ang=0, type=DC, "", "$\mathcal{E}_1 = 12\U{V}$");
+ TwoTerminal rb = resistor(ra.beg+(0,-u), ang=0, "$r_2 = 2.0\U{\Ohm}$", "");
+ TwoTerminal Bb = source(
+ rb.end, ang=0, type=DC, "", "$\mathcal{E}_2 = 18\U{V}$");
+ TwoTerminal R = resistor(
+ Bb.end+(0.5u,0.25u), ang=90, "", "$R = 6.6\U{\Ohm}$");
+ wire(rb.beg, ra.beg, rlsq, dist=-24pt);
wire(Bb.end, R.beg, rlsq);
wire(Ba.end, R.end, rlsq);
\end{asy}
\begin{asy}
import Circ;
real u = 3cm;
-TwoTerminal Bc = source((0,0), DC, 90, "", "$3.0\U{V}$");
-TwoTerminal Rcb = resistor(Bc.beg, normal, -90, "$10\U{\Ohm}$", "");
-TwoTerminal Rca = resistor(Bc.end, normal, 180, "", "$2\U{\Ohm}$");
+TwoTerminal Bc = source((0,0), ang=90, type=DC, "", "$3.0\U{V}$");
+TwoTerminal Rcb = resistor(Bc.beg, ang=-90, "$10\U{\Ohm}$", "");
+TwoTerminal Rca = resistor(Bc.end, ang=180, "", "$2\U{\Ohm}$");
pair Jtop = Rca.end, Jbot = (Jtop.x,Rcb.end.y);
-TwoTerminal Rb = resistor(Jtop, normal, -90, "$6\U{\Ohm}$", "");
-TwoTerminal Ba = source(Jtop, DC, 180, "", "$6.0\U{V}$");
-TwoTerminal Rab = resistor(Jbot, normal, 180, "$8\U{\Ohm}$", "");
-TwoTerminal Raa = resistor(Rab.end, normal, 90, "$12\U{\Ohm}$", "");
+TwoTerminal Rb = resistor(Jtop, ang=-90, "$6\U{\Ohm}$", "");
+TwoTerminal Ba = source(Jtop, ang=180, type=DC, "", "$6.0\U{V}$");
+TwoTerminal Rab = resistor(Jbot, ang=180, "$8\U{\Ohm}$", "");
+TwoTerminal Raa = resistor(Rab.end, ang=90, "$12\U{\Ohm}$", "");
wire(Ba.end, Raa.end, rlsq);
wire(Rab.beg, Jbot, nsq);
wire(Jbot, Rb.end, nsq);
\begin{asy}
import Circ;
TwoTerminal Bc = source((0,0), DC, 90, "", "$3.0\U{V}$");
-TwoTerminal Rcb = resistor(Bc.beg, normal, -90, "$10\U{\Ohm}$", "");
-TwoTerminal Rca = resistor(Bc.end, normal, 180, "", "$2\U{\Ohm}$");
+TwoTerminal Rcb = resistor(Bc.beg, ang=-90, "$10\U{\Ohm}$", "");
+TwoTerminal Rca = resistor(Bc.end, ang=180, "", "$2\U{\Ohm}$");
pair Jtop = Rca.end, Jbot = (Jtop.x,Rcb.end.y);
-TwoTerminal Ic = current((Jbot+Rcb.end)/2, 0, "", "$I_3$");
-TwoTerminal Rb = resistor(Jtop, normal, -90, "$6\U{\Ohm}$", "");
-TwoTerminal Ib = current(Rb.end, -90, "", "$I_2$");
-TwoTerminal Ba = source(Jtop, DC, 180, "", "$6.0\U{V}$");
-TwoTerminal Ia = current(Ba.end, 180, "$I_1$", "");
-TwoTerminal Rab = resistor(Jbot, normal, 180, "$8\U{\Ohm}$", "");
-TwoTerminal Raa = resistor(Rab.end, normal, 90, "$12\U{\Ohm}$", "");
+TwoTerminal Ic = current((Jbot+Rcb.end)/2, "", "$I_3$");
+TwoTerminal Rb = resistor(Jtop, ang=-90, "$6\U{\Ohm}$", "");
+TwoTerminal Ib = current(Rb.end, ang=-90, "", "$I_2$");
+TwoTerminal Ba = source(Jtop, ang=180, type=DC, "", "$6.0\U{V}$");
+TwoTerminal Ia = current(Ba.end, ang=180, "$I_1$", "");
+TwoTerminal Rab = resistor(Jbot, ang=180, "$8\U{\Ohm}$", "");
+TwoTerminal Raa = resistor(Rab.end, ang=90, "$12\U{\Ohm}$", "");
wire(Ia.end, Raa.end, rlsq);
wire(Jbot, Ib.end, nsq);
wire(Jbot, Ic.beg, nsq);
real a = u/2;
Surface surf = Surface(pFrom=(-.7u,-a/2), pTo=(2u,-a/2));
-Block b = Block(center=(0,0), side=a);
+Block b = Block(center=(0,0), width=a);
Spring spring = Spring(pFrom=(b.center+(a/2,0)), pTo=(2u,0));
Vector Fspring = Force(b.center, mag=2a, dir=0, L="$F_s$");
Vector Fexternal = Force(b.center, mag=2a, dir=180, L="$F_e$");
real r = 12pt; // radius of hanging mass
Mass m = Mass(radius=r, L="m");
-pair junction = m.center + (0, r+dx);
+pair junction = m.center() + (0, r+dx);
real theta = asin(D/L) * 180 / pi;
pair wall_join_r = junction + L/2*dir(90-theta);
pair surf_ur = wall_join_r + (0, dx);
-pair surf_lr = (surf_ur.x, m.center.y - r - dx);
+pair surf_lr = (surf_ur.x, m.center().y - r - dx);
Surface s_r = Surface(pFrom=surf_lr, pTo=surf_ur);
pair wall_join_l = xscale(-1)*wall_join_r;
pair surf_ul = xscale(-1)*surf_ur;
Surface s_l = Surface(pFrom=surf_ul, pTo=surf_ll);
Distance d = Distance(pFrom=wall_join_l, pTo=wall_join_r, L="$3L/4$");
-draw(m.center -- junction);
+draw(m.center() -- junction);
draw(wall_join_l -- junction -- wall_join_r);
s_r.draw();
s_l.draw();
dot(Listener);
label("Listener", Listener, E);
dAB.draw();
-dAL.draw(rotateLabel=false);
-dBL.draw(rotateLabel=false);
+dAL.draw();
+dBL.draw();
\end{asy}
\end{center}
\Part{a}
Block vib = Block((-w/2,0), width=w, height=w/3, L="vibrator");
Block obj = Block((L+(1+cos(pi/4))*A, -L/3), width=vib.height, L="$m$");
-Distance dL = Distance((0,vib.height/2), (L,vib.height/2), L="$L$");
+Distance dL = Distance((0,vib.height/2), (L,vib.height/2), L=Label("$L$", N));
draw(p, blue);
draw(yscale(-1)*p, blue+dotted);
Charge a = aCharge((0,0)*u, q=qa, L="$q_1$");
Charge b = aCharge((0.03,0)*u, q=qb, L="$q_2$");
-Distance r = Distance(a.center, b.center, L="$r$");
+Distance r = Distance(a.center(), b.center(), L="$r$");
Vector Fab = CoulombForce(a, b, scale=Fscale, L="$F$");
Vector Fba = CoulombForce(b, a, scale=Fscale, L="$F$");
Fab.mag /= 10.0; // Not part of Fscale b/c of rounding
Charge a = aCharge((0,0)*u, q=(qa+qb)/2, L="$Q/2$");
Charge b = aCharge((0.03,0)*u, q=(qa+qb)/2, L="$Q/2$");
-Distance r = Distance(a.center, b.center, L="$r$");
+Distance r = Distance(a.center(), b.center(), L="$r$");
Vector Fab = CoulombForce(a, b, scale=Fscale, L="$F$");
Vector Fba = CoulombForce(b, a, scale=Fscale, L="$F$");
}
linefit L=leastsquares(x, y);
-write("work function");
-write(L.b);
-write("h/e");
-write(L.m);
+write("work function ", L.b);
+write("h/e ", L.m);
real fit(real f)
{
real x = 2L;
m = Mass((x,h), radius=1.5mm);
-s = Spring(pFrom=(x,h+dL+L), pTo=m.center);
+s = Spring(pFrom=(x,h+dL+L), pTo=m.center());
s.draw();
m.draw();
real x = 3L;
-m.center = (x,h+A);
-s = Spring(pFrom=(x,h+dL+L), pTo=m.center);
+m.set_center((x,h+A));
+s = Spring(pFrom=(x,h+dL+L), pTo=m.center());
s.draw();
m.draw();
real x = 4L;
-m.center = (x,h-A);
-s = Spring(pFrom=(x,h+dL+L), pTo=m.center);
+m.set_center((x,h-A));
+s = Spring(pFrom=(x,h+dL+L), pTo=m.center());
s.draw();
m.draw();
real dx = 0.5u;
Distance Dh = Distance(pFrom=(0,0), pTo=(0,h), "$h$");
-Dh.draw(rotateLabel=false);
+Dh.draw();
Distance DdL = Distance(pFrom=(dx,h), pTo=(dx,h+dL), "$\Delta l$ ");
// inline asymptote crowds the label. this space intentional -^
-DdL.draw(rotateLabel=false);
+DdL.draw();
Distance DL = Distance(pFrom=(2dx,h+dL), pTo=(2dx,h+dL+L), "$L$");
-DL.draw(rotateLabel=false);
+DL.draw();
Distance Aup = Distance(pFrom=(3dx,h), pTo=(3dx,h+A), "$A$");
-Aup.draw(rotateLabel=false);
+Aup.draw();
Distance Adn = Distance(pFrom=(4dx,h-A), pTo=(4dx,h), "$A$");
-Adn.draw(rotateLabel=false);
+Adn.draw();
\end{asy}
\end{center}
real a=6.4; // degrees
real force=2u; // magnitude
Pendulum p = makePendulum(angleDeg=a, length=2u, stringL="$L$");
-p.mass.radius = 0;
-Vector fg = Force(p.mass.center/2, dir=-90, mag=force, L="$F_g$");
-Vector fgtan = Force(p.mass.center/2, dir=a-180, mag=force*sin(a), L=Label("$F_{\tan}$"));
-Vector v = Velocity(p.mass.center, dir=a, mag=0.5u, L="$v$");
+p.mass.lc.radius = 0;
+Vector fg = Force(p.mass.center()/2, dir=-90, mag=force, L="$F_g$");
+Vector fgtan = Force(p.mass.center()/2, dir=a-180, mag=force*sin(a),
+ L=Label("$F_{\tan}$"));
+Vector v = Velocity(p.mass.center(), dir=a, mag=0.5u, L="$v$");
fg.draw();
-fgtan.draw(labelOffset=(-2mm,1mm));
+fgtan.draw();
v.draw();
p.draw(drawVertical=true);
\end{asy}
real u = 1cm;
Pendulum p = makePendulum(angleDeg=25, length=2u, angleL="$\theta$");
-Spring s = Spring(pFrom=p.mass.center, pTo=p.mass.center+2u,
+Spring s = Spring(pFrom=p.mass.center(), pTo=p.mass.center()+2u,
unstretchedLength=2u);
s.draw();
Pendulum p = makePendulum(angleDeg=25, length=2u,
angleL="$\theta$", stringL="$r$");
-Spring s = Spring(pFrom=p.mass.center, pTo=p.mass.center+2u,
+Spring s = Spring(pFrom=p.mass.center(), pTo=p.mass.center()+2u,
unstretchedLength=2u, L="$k$");
-Vector fs = Force(p.mass.center, dir=180, mag=5mm, L="$F_s$");
-Vector fg = Force(p.mass.center, dir=-90, mag=7mm, L="$F_g$");
+Vector fs = Force(p.mass.center(), dir=180, mag=5mm, L="$F_s$");
+Vector fg = Force(p.mass.center(), dir=-90, mag=7mm, L="$F_g$");
s.draw();
fs.draw();
fg.draw();
p.draw(drawVertical=true);
-label("$m$", p.mass.center);
+label("$m$", p.mass.center());
\end{asy}
\end{center}
The spring is stretched or compressed by $x \approx r\sin(\theta)$
v.draw();
dot(v.center);
Distance dE = Distance(pFrom=(xpos, 0), pTo=(xpos, E), L="E");
-dE.draw(rotateLabel=false);
+dE.draw();
Distance dU = Distance(pFrom=(-xpos, 0), pTo=(-xpos, U), L="U");
-dU.draw(rotateLabel=false);
+dU.draw();
\end{asy}
\end{center}
\end{problem} % problem 28.62
import Mechanics;
real u = .5cm;
-Spring Su = Spring(pFrom=(0,0), pTo=(4u,0), k=500, L="$m$");
-Spring Sc = Spring(pFrom=(0,-2u), pTo=(3u,-2u), k=500, L="$m'$");
-Distance d = Distance(pFrom=(4u,-2u), pTo=(3u,-2u), scale=u, L=rotate(90)*Label("1 cm"));
+Spring Su = Spring(pFrom=(0,0), pTo=(4u,0), k=500, L=Label("$m$", N));
+Spring Sc = Spring(pFrom=(0,-2u), pTo=(3u,-2u), k=500, L=Label("$m'$", N));
+Distance d = Distance(pFrom=(4u,-2u), pTo=(3u,-2u), scale=u,
+ L=rotate(90)*Label("$1\U{cm}$", S));
Su.draw();
Sc.draw();
d.draw();
dot(f); // finish
Vector T1 = Vector((0,0), mag=length(f), dir=degrees(f), "tortoise");
-T1.draw(rotateLabel=true, labelOffset=-f/2);
+T1.draw();
Vector H1 = Vector((0,0), mag=length(h1), dir=degrees(h1), "hare");
-H1.draw(rotateLabel=true, labelOffset=-h1/2);
+H1.draw();
Vector H2 = Vector(h1, mag=length(h2-h1), dir=degrees(h2-h1), "pause");
-H2.draw(rotateLabel=true, labelOffset=-(h2-h1)*2/3);
+H2.draw();
Vector H3 = Vector(h2, mag=length(f-h2), dir=degrees(f-h2), "hare");
-H3.draw(rotateLabel=true, labelOffset=-(f-h2)/2);
+H3.draw();
xaxis("$x$");
yaxis("$t$");
pair a = (2u, 6u);
pair b = (3u, -2u);
Vector A = Vector((0,0), mag=length(a), dir=degrees(a), "$\vect{A}$");
-A.draw(rotateLabel=true);
+A.draw();
Vector B = Vector(a, mag=length(b), dir=degrees(b), "$\vect{B}$");
-B.draw(rotateLabel=true);
+B.draw();
Vector C = Vector((0,0), mag=length(a+b), dir=degrees(a+b), "$\vect{C}$");
-C.draw(rotateLabel=true, labelOffset=-(a+b)/3);
+C.draw();
\end{asy}
\hspace{1cm}
\begin{asy}
pair a = (2u, 6u);
pair b = (3u, -2u);
Vector A = Vector((0,0), mag=length(a), dir=degrees(a), "$\vect{A}$");
-A.draw(rotateLabel=true, labelOffset=-a/3);
+A.draw();
Vector B = Vector(a-b, mag=length(b), dir=degrees(b), "$\vect{B}$");
-B.draw(rotateLabel=true);
+B.draw();
Vector D = Vector((0,0), mag=length(a-b), dir=degrees(a-b), "$\vect{D}$");
-D.draw(rotateLabel=true);
+D.draw();
\end{asy}
\end{center}
pair D = -d;
Angle a = Angle((1,0), (0,0), d, red, "$-82.9\dg$");
-a.draw(labelOffsetAdjustment=2mm);
+a.draw();
Vector vd = Vector((0,0), mag=length(d), dir=degrees(d), "$(1,-8)$");
vd.draw();
Angle A = Angle((1,0), (0,0), D, blue, "$97.1\dg$");
-A.draw(labelOffsetAdjustment=2mm);
+A.draw();
Vector vD = Vector((0,0), mag=length(D), dir=degrees(D), "$(-1,8)$");
vD.draw();
Angle r = Angle(d, (0, 0), D, radius=15mm, green, "$180.0\dg$");
-r.draw(labelOffsetAdjustment=4mm);
+r.draw();
xaxis("$x$");
\end{asy}
draw((0,-5u)--(0, 20u), dashed); // line of scrimmage
Vector vDrop = Vector((0,0), mag=length(drop), dir=degrees(drop), "drop");
-vDrop.draw(labelOffset=-drop/2);
+vDrop.draw();
Vector vScramble = Vector(
drop, mag=length(scramble), dir=degrees(scramble), "scramble");
-vScramble.draw(rotateLabel=true, labelOffset=-scramble/2);
+vScramble.draw();
Vector vPass = Vector(drop+scramble, mag=length(pass), dir=degrees(pass),
"pass");
-vPass.draw(rotateLabel=true, labelOffset=-pass/2);
+vPass.draw();
Vector vResult = Vector((0,0), mag=length(result), dir=degrees(result),
"result");
-vResult.draw(rotateLabel=true, labelOffset=-result/2);
+vResult.draw();
\end{asy}
\end{center}
Angle a = Angle((1,0), (0,0), dir(60), "$\theta_1$");
a.draw();
-Vector A = Vector((0,0), mag=120u, dir=60, "$\vect{F}_1$");
+Vector A = Vector((0,0), mag=120u, dir=60,
+ L=Label("$\vect{F}_1$", position=EndPoint, align=RightSide));
A.draw();
Angle b = Angle((-1,0), (0,0), dir(180-75), "$\theta_2$");
b.draw();
-Vector B = Vector((0,0), mag=80u, dir=180-75, "$\vect{F}_2$");
+Vector B = Vector((0,0), mag=80u, dir=180-75,
+ L=Label("$\vect{F}_2$", position=EndPoint, align=LeftSide));
B.draw();
xaxis("$x$");
pair b = 40u * dir(45);
pair c = 30u * dir(-45);
-Vector A = Vector((0,0), mag=length(a), dir=degrees(a), "$\vect{A}$");
+Vector A = Vector((0,0), mag=length(a), dir=degrees(a),
+ L=Label("$\vect{A}$", position=EndPoint, align=E));
A.draw();
-Vector B = Vector((0,0), mag=length(b), dir=degrees(b), "$\vect{B}$");
+Vector B = Vector((0,0), mag=length(b), dir=degrees(b),
+ L=Label("$\vect{B}$", position=EndPoint, align=RightSide));
B.draw();
-Vector C = Vector((0,0), mag=length(c), dir=degrees(c), "$\vect{C}$");
+Vector C = Vector((0,0), mag=length(c), dir=degrees(c),
+ L=Label("$\vect{C}$", position=EndPoint, align=LeftSide));
C.draw();
xaxis("$x$");
Vector C = Vector(a+b, mag=length(c), dir=degrees(c), "$\vect{C}$");
C.draw();
Vector R = Vector((0,0), mag=length(r), dir=degrees(r), "$\vect{r}$");
-R.draw(labelOffset=-r/2);
+R.draw();
xaxis("$x$");
yaxis("$y$");
Surface s = Surface((-dx,0), (d+dx,0));
s.draw();
-Vector A = Vector((0,0), mag=h, dir=90, "$\vect{R}_0$");
+Vector A = Vector((0,0), mag=h, dir=90,
+ L=Label("$\vect{R}_0$", position=EndPoint, align=W));
A.draw();
-Vector B = Vector((0,0), mag=length((d,h)), dir=degrees((d,h)), "$\vect{R}_{30}$");
+Vector B = Vector((0,0), mag=length((d,h)), dir=degrees((d,h)),
+ L=Label("$\vect{R}_{30}$", position=EndPoint, align=RightSide));
B.draw();
\end{asy}
\end{center}
a1.draw();
a2.draw();
-A1.draw(labelOffsetAdjustment=12pt);
+A1.draw();
A3.draw();
draw((-7mm,0)--(7mm,0));
draw((12mm*dir(-90+theta2))--(0,0)--(12mm*dir(180+theta2)));
Block m2 = Block(
m2bot + a/2*m2perp, width=a, height=a, direction=-theta, "$m_2$");
-pair ropecross = extension(m1.center, m1.center+N,
+pair ropecross = extension(m1.center(), m1.center()+N,
m2.center, m2.center+(top-botR));
pair pulley = ropecross + (pr, -pr/Tan(theta/2));
filldraw(botL -- botR -- top -- cycle, fillpen=rgb(0.8,0.8,0.3));
A.draw();
-draw(m1.center -- (m1.center.x, pulley.y));
+draw(m1.center() -- (m1.center().x, pulley.y));
draw(m2.center -- (pulley + pr*m2perp));
filldraw(shift(pulley)*scale(pr)*unitcircle, fillpen=white);
real u = 1cm;
Mass m = Mass((u,0), "$m$");
-Vector F = Force(m.center, mag=0.7u, dir=180, "$F_f$");
+Vector F = Force(m.center(), mag=0.7u, dir=180, "$F_f$");
draw(scale(u)*unitcircle);
Distance r = Distance((0,0), u*dir(45), "$r$");
real theta = aTan(a/g);
Mass m = Mass(L*dir(-90-theta), "$m$");
-draw((0,0)--m.center);
+draw((0,0)--m.center());
m.draw();
draw((0,0)--(0, -0.5L), dashed);
-Angle T = Angle((0,-1), (0,0), m.center, "$\theta$");
+Angle T = Angle((0,-1), (0,0), m.center(), "$\theta$");
T.draw();
dot((0,0));
// Vector A = Acceleration
real u = 16cm;
-Charge a = pCharge((0,0), 5, L="$5.00\U{nC}$");
-Charge b = pCharge((0.3u,0), 6, L="$6.00\U{nC}$");
-Charge c = nCharge((0,-0.1u), -3, L="$-3.00\U{nC}$");
-Distance dab = Distance(a.center, b.center, scale=u, L="$0.300\U{m}$");
+Charge a = pCharge((0,0), 5, L=Label("$5.00\U{nC}$", align=N));
+Charge b = pCharge((0.3u,0), 6, L=Label("$6.00\U{nC}$", align=N));
+Charge c = nCharge((0,-0.1u), -3, L=Label("$-3.00\U{nC}$", align=S));
+Distance dab = Distance(a.center(), b.center(), scale=u, L="$0.300\U{m}$");
Distance dac = Distance(
- a.center, c.center, offset=-0.1u, scale=u, L="$0.100\U{m}$");
+ a.center(), c.center(), offset=-0.1u, scale=u, L="$0.100\U{m}$");
a.draw(); b.draw(); c.draw(); dab.draw(); dac.draw();
draw_ijhat((-0.1u,-0.08u));
\end{asy}
real u = 1.5cm;
-Charge a = pCharge((0,0), 2, L="$2Q$");
-Charge b = nCharge((u,0), -1, L="$-Q$");
-Charge c = pCharge((0,u), 1, L="$Q$");
+Charge a = pCharge((0,0), 2, L=Label("$2Q$", align=S));
+Charge b = nCharge((u,0), -1, L=Label("$-Q$", align=S));
+Charge c = pCharge((0,u), 1, L=Label("$Q$", align=S));
Distance dab = Distance(
- a.center, b.center, offset=0.5u, scale=u, L="$d$");
+ a.center(), b.center(), offset=0.5u, scale=u, L="$d$");
Distance dac = Distance(
- a.center, c.center, offset=-0.5u, scale=u, L="$d$");
+ a.center(), c.center(), offset=-0.5u, scale=u, L="$d$");
draw_ijhat((0,0));
a.draw(); b.draw(); c.draw(); dab.draw(); dac.draw();
\end{asy}
Surface c1 = Surface(pFrom=(ceil_width,0), pTo=(-ceil_width,0));
Charge a1 = pCharge((0, -initial_stretch), L="$q_1$");
-Spring s1 = Spring(pFrom=(0,0), pTo=a1.center);
+Spring s1 = Spring(pFrom=(0,0), pTo=a1.center());
c1.draw(); s1.draw(); a1.draw();
Surface c2 = Surface(pFrom=(frame_space+ceil_width,0),
pTo=(frame_space-ceil_width,0));
-Charge a2 = pCharge((frame_space, -initial_stretch-dx));
-Charge b = nCharge(a2.center - (0, dab), L="$q_2$");
-Spring s2 = Spring(pFrom=(frame_space,0), pTo=a2.center);
+Charge a2 = pCharge((frame_space, -initial_stretch-dx), L="$q_1$");
+Charge b = nCharge(a2.center() - (0, dab), L="$q_2$");
+Spring s2 = Spring(pFrom=(frame_space,0), pTo=a2.center());
c2.draw(); s2.draw(); a2.draw(); b.draw();
\end{asy}
\end{center}
Charge a = pCharge((x,y));
-Vector T = Vector(a.center, mag=T_mag, dir=90+theta, "$T$");
+Vector T = Vector(a.center(), mag=T_mag, dir=90+theta, "$T$");
T.draw();
-Vector G = Vector(a.center, mag=G_mag, dir=-90, "$mg$");
+Vector G = Vector(a.center(), mag=G_mag, dir=-90, "$mg$");
G.draw();
-Vector E = Vector(a.center, mag=E_mag, dir=E_dir, "$F_E$");
+Vector E = Vector(a.center(), mag=E_mag, dir=E_dir, "$F_E$");
E.draw();
a.draw();
}
Charge a = pCharge((-0.5*width-12pt, 0), "$+$");
-Vector v = Velocity(a.center, dir=0);
+Vector v = Velocity(a.center(), dir=0);
v.draw();
a.draw();
}
Charge a = nCharge((0.5*width+12pt, 0), "$-$");
-Vector v = Velocity(a.center, dir=180);
+Vector v = Velocity(a.center(), dir=180);
v.draw();
a.draw();
}
Charge a = pCharge((0.5*width+12pt, 0), "$+$");
-Vector v = Velocity(a.center, dir=180);
+Vector v = Velocity(a.center(), dir=180);
v.draw();
a.draw();
t.draw();
Charge a = pCharge((0, -0.5*height-12pt), "$+$");
-Vector v = Velocity(a.center, dir=90);
+Vector v = Velocity(a.center(), dir=90);
v.draw();
a.draw();
real u=1cm;
-Vector f = Force(mag=u, dir=90, "$\vect{F}_B$");
+Vector f = Force(mag=u, dir=90, Label("$\vect{F}_B$", EndPoint, N));
f.draw();
-Vector v = Velocity(mag=u, dir=0, "$\vect{v}$");
+Vector v = Velocity(mag=u, dir=0, Label("$\vect{v}$", EndPoint, S));
v.draw();
label("\Part{a}", (0,0), S);
\end{asy}
real u=1cm;
-Vector f = Force(mag=u, dir=90, "$\vect{F}_B$");
+Vector f = Force(mag=u, dir=90, Label("$\vect{F}_B$", EndPoint, N));
f.draw();
-Vector v = Velocity(mag=u, phi=90, "$\vect{v}$");
+Vector v = Velocity(mag=u, phi=90, Label("$\vect{v}$", EndPoint, S));
v.draw();
label("\Part{b}", (0,0), S);
\end{asy}
real u=1cm;
-Vector f = Force(mag=u, dir=180, "$\vect{F}_B$");
+Vector f = Force(mag=u, dir=180, Label("$\vect{F}_B$", EndPoint, N));
f.draw();
-Vector v = Velocity(mag=u, phi=-90, "$\vect{v}$");
+Vector v = Velocity(mag=u, phi=-90, Label("$\vect{v}$", EndPoint, S));
v.draw();
label("\Part{c}", (0,0), S);
\end{asy}
}
Charge a = nCharge((-0.5*width-24pt, 0), "$e^-$");
-Vector v = Velocity(a.center, dir=0, "$\vect{v}$");
+Vector v = Velocity(a.center(), dir=0, "$\vect{v}$");
v.draw();
a.draw();
Charge a = neutralCharge(dir(-90+phi)*L*u, L="$q_R$");
Charge b = neutralCharge(dir(-90-phi)*L*u, L="$q_L$");
-Wire La = Wire((0,0), a.center, L="$L$");
-Wire Lb = Wire(b.center, (0,0), L="$L$");
-Angle theta = Angle(a.center, (0,0), b.center, L="$\theta$");
-Surface s = Surface((a.center.x, 0), (b.center.x, 0));
-Vector E = EField(a.center - (0,dy)*u, mag=(a.center.x - b.center.x), dir=-180, L="$E$");
+Wire La = Wire((0,0), a.center(), L=Label("$L$", align=NW, embed=Shift));
+Wire Lb = Wire(b.center(), (0,0), L=Label("$L$", align=NE, embed=Shift));
+Angle theta = Angle(a.center(), (0,0), b.center(), L="$\theta$");
+Surface s = Surface((a.center().x, 0), (b.center().x, 0));
+Vector E = EField(a.center() - (0,dy)*u, mag=(a.center().x - b.center().x),
+ dir=-180, L="$E$");
s.draw();
-La.draw(rotateLabel=false);
-Lb.draw(rotateLabel=false);
+La.draw();
+Lb.draw();
theta.draw();
E.draw();
a.draw();
Charge a = nCharge(dir(-90+phi)*L*u, L="$q_{R-}$");
Charge b = pCharge(dir(-90-phi)*L*u, L="$q_{L+}$");
-Wire La = Wire((0,0), a.center, L="$L$");
-Wire Lb = Wire(b.center, (0,0), L="$L$");
-Angle theta = Angle(a.center, (0,0), b.center, L="$\theta$");
-Surface s = Surface((a.center.x, 0), (b.center.x, 0));
-Vector E = EField(a.center - (0,dy)*u, mag=(a.center.x - b.center.x), dir=-180, L="$E$");
+Wire La = Wire((0,0), a.center(), L="$L$");
+Wire Lb = Wire(b.center(), (0,0), L="$L$");
+Angle theta = Angle(a.center(), (0,0), b.center(), L="$\theta$");
+Surface s = Surface((a.center().x, 0), (b.center().x, 0));
+Vector E = EField(a.center() - (0,dy)*u, mag=(a.center().x - b.center().x),
+ dir=-180, L="$E$");
s.draw();
-La.draw(rotateLabel=false);
-Lb.draw(rotateLabel=false);
+La.draw();
+Lb.draw();
theta.draw();
E.draw();
a.draw();
real phi = 30; // Half angle between cables
Charge a = nCharge();
-Vector Fq = Force(a.center, mag=.4cm, dir=-180, L="$F_q$");
-Vector FT = Force(a.center, mag=1cm, dir=90+phi, L="$F_T$");
-Vector FE = Force(a.center, mag=Sin(phi)*FT.mag+Fq.mag, dir=0, L="$F_E$");
-Vector Fg = Force(a.center, mag=Cos(phi)*FT.mag, dir=-90, L="$F_g$");
+Vector Fq = Force(a.center(), mag=.4cm, dir=-180, L="$F_q$");
+Vector FT = Force(a.center(), mag=1cm, dir=90+phi, L="$F_T$");
+Vector FE = Force(a.center(), mag=Sin(phi)*FT.mag+Fq.mag, dir=0, L="$F_E$");
+Vector Fg = Force(a.center(), mag=Cos(phi)*FT.mag, dir=-90, L="$F_g$");
Fq.draw();
FT.draw();
FE.draw();
a.draw();
Charge b = pCharge((-2cm, 0));
-Fq.center = FT.center = FE.center = Fg.center = b.center;
+Fq.center = FT.center = FE.center = Fg.center = b.center();
Fq.dir += 180;
FT.dir -= 2*phi;
FE.dir += 180;
Fg.draw();
b.draw();
-draw_ijhat((a.center+b.center)/2 - (0,1cm));
+draw_ijhat((a.center()+b.center())/2 - (0,1cm));
\end{asy}
\end{center}
int n=3;
Charge q = aCharge((0,0)*u, q=1, L="$q$");
-Vector v = Velocity(q.center, L="$v$");
+Vector v = Velocity(q.center(), L="$v$");
Wire top_plate = Wire((0,0.5*dy)*u, (L,.5*dy)*u);
Wire bottom_plate = Wire((0,-.5*dy)*u, (L,-.5*dy)*u);
E.draw();
}
-path p = q.center;
+path p = q.center();
real x, y, frac;
int m = 20;
for (int i=0; i<=m; i+= 1) {
frac = i/m;
x = L*frac;
y = 0.4*dy*frac**2;
- p = p..(q.center + (x,y)*u);
+ p = p..(q.center() + (x,y)*u);
}
draw(p, grey);
v.draw();
q.draw();
-draw_ijhat(q.center - (1,0)*u);
+draw_ijhat(q.center() - (1,0)*u);
\end{asy}
\end{center}
From the forces on the drop in each direction
Charge qO = pCharge((0,0), L="$q_1$");
Charge qT = nCharge((dOT,0)*u, L="$q_2$");
-pair A = (qO.center+qT.center)/2.0;
+pair A = (qO.center()+qT.center())/2.0;
// x^2 + y^2 = dOB^2
-// (x-a)^2 + y^2 = dTB^2 where a=qT.center.x
+// (x-a)^2 + y^2 = dTB^2 where a=qT.center().x
// so
// 2xa - a^2 = dOB^2 - dTB^2
// x = (dOB^2 - dTB^2 + a^2)/(2a)
// y = (dOB^2-x^2)^0.5
real Bx = (dOB**2 - dTB**2 + dOT**2)/(2*dOT);
pair B = (Bx,(dOB**2-Bx**2)**0.5)*u;
-Distance DOA = Distance(qO.center, A, L=Label("$0.050\U{m}$", align=S));
-Distance DTA = Distance(A, qT.center, L=Label("$0.050\U{m}$", align=S));
-Distance DOB = Distance(qO.center, B, L=Label("$0.080\U{m}$", align=NW));
-Distance DTB = Distance(B, qT.center, L=Label("$0.060\U{m}$", align=NE));
+Distance DOA = Distance(qO.center(), A, L=Label("$0.050\U{m}$", align=S));
+Distance DTA = Distance(A, qT.center(), L=Label("$0.050\U{m}$", align=S));
+Distance DOB = Distance(qO.center(), B, L=Label("$0.080\U{m}$", align=NW));
+Distance DTB = Distance(B, qT.center(), L=Label("$0.060\U{m}$", align=NE));
DOA.draw(); DTA.draw(); DOB.draw(); DTB.draw();
dot(A, L="$A$", align=S);
int n=3;
Charge q = pCharge(dir(-90+phi)*L*u, q=1, L="$q$");
-Wire wire = Wire((0,0), q.center);
-Angle theta = Angle(q.center, (0,0), (0,-1), L="$\theta$");
+Wire wire = Wire((0,0), q.center());
+Angle theta = Angle(q.center(), (0,0), (0,-1), L="$\theta$");
Surface s = Surface((ds/2,0)*u, (-ds/2,0)*u);
Wire right_plate = Wire((ds,0)*u, (ds,-dy)*u, outline=green);
Wire left_plate = Wire((-ds,0)*u, (-ds,-dy)*u, outline=green);
s.draw();
Ds.draw();
wire.draw();
-draw((0,0)--(0,q.center.y), dashed);
+draw((0,0)--(0,q.center().y), dashed);
q.draw();
theta.draw();
\end{asy}
int n=3;
Charge q = nCharge((-1,0)*u, q=1);
-Vector v = Velocity(q.center, L="$v$");
+Vector v = Velocity(q.center(), L="$v$");
Wire top_plate = Wire((0,0.5*dy)*u, (L,.5*dy)*u);
Wire bottom_plate = Wire((0,-.5*dy)*u, (L,-.5*dy)*u);
Wire screen = Wire((L+s,-.7*dy)*u, (L+s,+.7*dy)*u, L="screen");
draw(scale(u)*((0,0)--(1,0)--(1,1)--(0,1)--cycle), blue);
draw(scale(u)*((-.25,.25)--(.25,.25)--(.25,.75)--(1.25,.75)), red);
I.draw();
-Dhorizontal.draw(labelangle=-90, labeloffset=8pt);
-Dvertical.draw(labelangle=-90, labeloffset=8pt);
-Dbend.draw(rotateLabel=false, labelangle=-90, labeloffset=22pt);
+Dhorizontal.draw();
+Dvertical.draw();
+Dbend.draw();
\end{asy}
\end{center}
\end{problem*}
for (i=0; i<n; i+=1) {
Bs.push(BField((xB, yBstart+i*dy), mag=Rh.len));
if (i == n-1)
- Bs[i].L = "\vect{B}";
+ Bs[i].label = Label("\vect{B}", EndPoint, LeftSide);
}
for (i=0; i<Bs.length; i+=1) {
Bs[i].draw();
draw(scale(r)*unitcircle, Bs[0].outline+dashed);
Distance Dwire = Distance((pLL+2*pLR)/3, (pUL+2pUR)/3, "$45.0\U{cm}$");
-Dwire.draw(rotateLabel=false, labeloffset=24pt);
+Dwire.draw();
Distance DdB = Distance((+r,-r), (-r,-r), offset=-3mm, L="$75.0\U{cm}$");
-DdB.draw(rotateLabel=false, labeloffset=12pt);
+DdB.draw();
\end{asy}
\end{center}
\end{problem*}
Distance dtop = Distance((-Xsep,Ysep/2), (0,0), "$8.00\U{cm}$");
Distance dbot = Distance((-Xsep,-Ysep/2), (0,0), "$8.00\U{cm}$");
-dtop.draw(labeloffset=8pt);
-dbot.draw(labeloffset=-8pt);
+dtop.draw();
+dbot.draw();
dot("P", (0,0));
wbot_seg.draw();
TwoTerminal Ibot = current((0,-Ysep/2), 180, "$24.0\U{A}$");
Distance dSegbot = Distance((-Xsep-Xseg/2,-Ysep/2), (-Xsep+Xseg/2,-Ysep/2),
- offset=2mm, "$1.50\U{mm}$");
-dSegbot.draw(labeloffset=-8pt);
+ offset=2mm, L=Label("$1.50\U{mm}$", S));
+dSegbot.draw();
Wire wtop_seg = Wire((-Xsep-Xseg/2, Ysep/2), (-Xsep+Xseg/2, Ysep/2), red);
wtop_seg.draw();
TwoTerminal Itop = current((Ibot.end.x,Ysep/2), "$12.0\U{A}$");
Distance dSegtop = Distance((-Xsep-Xseg/2,Ysep/2), (-Xsep+Xseg/2,Ysep/2),
- offset=-2mm, "$1.50\U{mm}$");
-dSegtop.draw(labeloffset=8pt);
+ offset=-2mm, Label("$1.50\U{mm}$", N));
+dSegtop.draw();
\end{asy}
\end{center}
Block Bt = Block((0,0), width=L, height=hBar, fill=yellow);
Block Bb = Block((0,-d), width=L, height=hBar, fill=yellow);
Spring Sl = Spring((-L/2,-d), (-L/2,0),
- deadLength=1mm, unstretchedLength=d, "k");
+ deadLength=1mm, unstretchedLength=d, L=Label("$k$", embed=Shift));
Spring Sr = Spring((L/2,0), (L/2,-d),
- deadLength=1mm, unstretchedLength=d, "k");
+ deadLength=1mm, unstretchedLength=d, L=Label("$k$", embed=Shift));
Vector It = Vector((0,Isep), dir=0, ipen);
Vector Ib = Vector((0,-d-Isep), dir=180, ipen);
-Distance DL = Distance((-L/2,0), (L/2,0), offset=-2Isep, "$L$");
-Distance Dd = Distance((L/2,0), (L/2,-d), offset=-4Isep, "$d$");
+Distance DL = Distance((-L/2,0), (L/2,0), offset=-2Isep, Label("$L$", N));
+Distance Dd = Distance((L/2,0), (L/2,-d), offset=-4Isep,
+ Label("$d$", embed=Shift));
-Sl.draw(rotateLabel=false);
-Sr.draw(rotateLabel=false);
+Sl.draw();
+Sr.draw();
Bt.draw();
Bb.draw();
It.draw();
Ib.draw();
DL.draw();
-Dd.draw(rotateLabel=false);
+Dd.draw();
\end{asy}
\end{center}
\end{problem*}
Distance Dw = Distance((-width/2,height/2), (width/2,height/2),
- offset=-6pt, "$30.0\U{cm}$");
+ offset=-6pt, Label("$30.0\U{cm}$", align=LeftSide));
Distance Dh = Distance((-width/2,-height/2), (-width/2,height/2),
- offset=-6pt, "$40.0\U{cm}$");
-Dw.draw(labeloffset=8pt);
-Dh.draw(labeloffset=8pt);
+ offset=-6pt, Label("$40.0\U{cm}$", align=LeftSide));
+Dw.draw();
+Dh.draw();
draw(scale(width/2,height/2)*((1,1)--(1,-1)--(-1,-1)--(-1,1)--cycle), yellow);
\end{asy}
pair A = scale(length/2)*rotate(angle)*(0,-1);
pair B = scale(length/2)*rotate(angle)*(0,1);
-Distance L = Distance(A, B, offset=-6pt, "$L$");
+Distance L = Distance(A, B, offset=-6pt, L=Label("$L$", align=LeftSide));
L.draw();
draw(A--B, yellow);
label("$d$", (-width/2+xSep,-ySep/2), S);
Distance D = Distance((width/2,ySep/2), (width/2,-ySep/2),
- offset=-6pt, "50.0\U{cm}");
-D.draw(labeloffset=8pt);
+ offset=-6pt, L=Label("$50.0\U{cm}$", align=LeftSide));
+D.draw();
\end{asy}
\end{center}
\end{problem*}
real u = 1cm;
Pendulum pA = makePendulum(angleDeg=-40, length=2u,
- angleL="$\theta$", stringL="$r$");
+ angleL="$\theta$", stringL=Label("$r$", embed=Shift));
Pendulum pB = makePendulum(angleDeg=40, length=2u,
- angleL="$\theta$", stringL="$r$");
-Spring s = Spring(pFrom=pA.mass.center, pTo=pB.mass.center,
- unstretchedLength=abs(pA.mass.center.x)*2,
- L="$k$");
+ angleL="$\theta$", stringL=Label("$r$", align=LeftSide, embed=Shift));
+Spring s = Spring(pFrom=pA.mass.center(), pTo=pB.mass.center(),
+ unstretchedLength=abs(pA.mass.center().x)*2, L="$k$");
Distance ds = Distance(pFrom=s.pFrom-(0,.7u),
pTo=s.pTo -(0,.7u),
L="$d$");
ds.draw();
pA.draw(drawVertical=true);
pB.draw();
-label("$m$", pA.mass.center);
-label("$m$", pB.mass.center);
+label("$m$", pA.mass.center());
+label("$m$", pB.mass.center());
\end{asy}
\end{center}
\end{problem}
Pendulum p = makePendulum(angleDeg=-40, length=2u,
angleL="$\theta$", stringL="$r$");
-Spring s = Spring(pFrom=p.mass.center, pTo=(0,p.mass.center.y),
- unstretchedLength=abs(p.mass.center.x),
+Spring s = Spring(pFrom=p.mass.center(), pTo=(0,p.mass.center().y),
+ unstretchedLength=abs(p.mass.center().x),
L="$2k$");
Distance ds = Distance(pFrom=s.pFrom-(0,.7u),
pTo=s.pTo -(0,.7u),
s.draw();
ds.draw();
p.draw(drawVertical=true);
-label("$m$", p.mass.center);
+label("$m$", p.mass.center());
\end{asy}
\end{center}
where the spring constant doubles, because when the left bob
Pendulum p = makePendulum(angleDeg=-40, length=2u,
angleL="$\theta$");
-Vector fs = Force(p.mass.center, dir=180, mag=1u, L="$F_s$");
-Vector fg = Force(p.mass.center, dir=-90, mag=1u, L="$F_g$");
-Vector dx = Vector(p.mass.center, dir=-40-180, mag=1.5u, L="$x'$");
-Vector dy = Vector(p.mass.center, dir=-40-90, mag=1.5u, L="$y'$");
-Angle xas = Angle(dx.pTip(), p.mass.center, fs.pTip(), L="$\theta$");
-Angle yag = Angle(dy.pTip(), p.mass.center, fg.pTip(), L="$\theta$");
+Vector fs = Force(p.mass.center(), dir=180, mag=1u, L="$F_s$");
+Vector fg = Force(p.mass.center(), dir=-90, mag=1u, L="$F_g$");
+Vector dx = Vector(p.mass.center(), dir=-40-180, mag=1.5u, L="$x'$");
+Vector dy = Vector(p.mass.center(), dir=-40-90, mag=1.5u, L="$y'$");
+Angle xas = Angle(dx.pTip(), p.mass.center(), fs.pTip(), L="$\theta$");
+Angle yag = Angle(dy.pTip(), p.mass.center(), fg.pTip(), L="$\theta$");
xas.draw();
yag.draw();