Add aCharge tests to ElectroMag-test.asy.
authorW. Trevor King <wking@drexel.edu>
Fri, 20 May 2011 18:20:11 +0000 (14:20 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 20 May 2011 18:20:11 +0000 (14:20 -0400)
asymptote/ElectroMag-test.asy

index 8cf5617683507981dee11f3477f72bc4db906b72..c37c9cb2b792ba5d51aa1bc3caa5206c10e502a3 100644 (file)
@@ -22,7 +22,7 @@ import ElectroMag;
 real u = 1cm;
 
 Charge a = pCharge(center=(0.5u,2u));
-Charge b = pCharge(center=(0,0));
+Charge b = aCharge(center=(0,0), q=1);
 Charge c = nCharge(center=(-3u,0), q=-3);
 Charge cs[] = {a,b,c};
 Distance dab = Distance(b.center, a.center, scale=u, L="$r_1$");
@@ -45,8 +45,11 @@ for (int i=0; i<as.length; i+=1)
 //Fba.draw();
 CoulombForces(c=cs, scale=2u, unit=u);
 
-Charge a = pCharge(center=(-2u, 2u));
+Charge a = aCharge(center=(-2u, 2u), q=0);
 a.draw();
 Vector v = EField(a.center, mag=u/2, dir=0,L="E"); v.draw();
 Vector v = BField(a.center, mag=u/2, dir=90,L="B"); v.draw();
 Vector v = Velocity(a.center, mag=u/2, dir=180,L="$v$"); v.draw();
+
+a = aCharge(center=(-3u, 2u), q=-1);
+a.draw();