real u = 2cm, v=0;
write("resistor");
-TwoTerminal Rn = resistor((0,v), normal, 0, "$R_{normal}$", "30\ohm");
+TwoTerminal Rn = resistor((0,v), 0, normal, "$R_{normal}$", "30\ohm");
dot("beg", Rn.beg, NW);
dot("end", Rn.end, NE);
dot("mid", Rn.mid, S);
-TwoTerminal Rvb = resistor((2u,v), variable, 0, "$R_{variable}$", "30\kohm");
+TwoTerminal Rvb = resistor((2u,v), 0, variable, "$R_{variable}$", "30\kohm");
v -= u;
write("capacitor");
-TwoTerminal Cn = capacitor((0,v), normal, 0, "$C_{normal}$", "30 $\mu$F");
-TwoTerminal Ce = capacitor((u,v), electrolytic, 0, "$C_{electrolytic}$", "30 $\mu$F");
-TwoTerminal Cvb = capacitor((2u,v), variable, 0, "$C_{variable}$", "30 $\mu$F");
-TwoTerminal Cvt = capacitor((3u,v), variant, 0, "$C_{variant}$", "30 $\mu$F");
+TwoTerminal Cn = capacitor((0,v), 0, normal, "$C_{normal}$", "30 $\mu$F");
+TwoTerminal Ce = capacitor((u,v), 0, electrolytic, "$C_{electrolytic}$", "30 $\mu$F");
+TwoTerminal Cvb = capacitor((2u,v), 0, variable, "$C_{variable}$", "30 $\mu$F");
+TwoTerminal Cvt = capacitor((3u,v), 0, variant, "$C_{variant}$", "30 $\mu$F");
v -= u;
write("inductor");
-TwoTerminal Lup = inductor((0,v), Up, 0, "$L_{Up}$", "30 H");
-TwoTerminal Ldown = inductor((u,v), Down, 0, "$L_{Down}$", "30 H");
+TwoTerminal Lup = inductor((0,v), 0, Up, "$L_{Up}$", "30 H");
+TwoTerminal Ldown = inductor((u,v), 0, Down, "$L_{Down}$", "30 H");
v -= u;
write("diode");
-TwoTerminal Dn = diode((0,v), normal, 0, "$D_{normal}$", "1.3 V");
-TwoTerminal Dz = diode((u,v), zener, 0, "$D_{zener}$", "1.3 V");
-TwoTerminal Dled = diode((2u,v), LED, 0, "$D_{LED}$", "1.7 V");
+TwoTerminal Dn = diode((0,v), 0, normal, "$D_{normal}$", "1.3 V");
+TwoTerminal Dz = diode((u,v), 0, zener, "$D_{zener}$", "1.3 V");
+TwoTerminal Dled = diode((2u,v), 0, LED, "$D_{LED}$", "1.7 V");
v -= u;
write("battery");
v -= u;
write("switch");
-TwoTerminal B = switchSPST((0,v), NO, 0, "$S_{NO}$", "Open");
-TwoTerminal B = switchSPST((u,v), NC, 0, "$S_{NC}$", "Closed");
+TwoTerminal B = switchSPST((0,v), 0, NO, "$S_{NO}$", "Open");
+TwoTerminal B = switchSPST((u,v), 0, NC, "$S_{NC}$", "Closed");
v -= u;
write("current");
v -= u;
write("source");
-TwoTerminal Sdc = source((0,v), DC, 0, "DC", "5 V");
-TwoTerminal Sac = source((u,v), AC, 0, "AC", "5 V$_{pp}$");
-TwoTerminal Si = source((2u,v), I, 0, "I", "5 A");
-TwoTerminal Sv = source((3u,v), V, 0, "V", "5 V");
+TwoTerminal Sdc = source((0,v), 0, DC, "DC", "5 V");
+TwoTerminal Sac = source((u,v), 0, AC, "AC", "5 V$_{pp}$");
+TwoTerminal Si = source((2u,v), 0, I, "I", "5 A");
+TwoTerminal Sv = source((3u,v), 0, V, "V", "5 V");
v -= 1.5u;
write("positioning");
-TwoTerminal Spos = source((u,v), DC, 90, "DC", "5 V");
-TwoTerminal Rpos = resistor((0,0), normal, 0, "+offset", "5 \ohm", draw=false);
+TwoTerminal Spos = source((u,v), 90, DC, "DC", "5 V");
+TwoTerminal Rpos = resistor((0,0), 0, normal, "+offset", "5 \ohm", draw=false);
Rpos.centerto(Spos.beg, Spos.end, offset=u);
Rpos.draw();
dot("Sa", Spos.beg, S);
dot("Sb", Spos.end, N);
dot("Ra", Rpos.beg, S);
dot("Rb", Rpos.end, N);
-TwoTerminal Cpos = capacitor((0,0), normal, 0, "-2offset", "4 F",draw=false);
+TwoTerminal Cpos = capacitor((0,0), 0, normal, "-2offset", "4 F",draw=false);
Cpos.centerto(Spos.beg, Spos.end, offset=-2u);
Cpos.draw();
v -= u;
real rstlth=2mm;
int normal=0, variable=2;
-TwoTerminal resistor(pair beg=(0,0), int type=normal, real ang=(0,0),
+TwoTerminal resistor(pair beg=(0,0), real ang=0, int type=normal,
string name="", string val="", bool draw=true)
{
path pLine, pMisc[]={};
real coil=2mm;
int Up=0, Down=1;
-TwoTerminal inductor(pair beg=(0,0), int type=Up, real ang=0, string name="",
+TwoTerminal inductor(pair beg=(0,0), real ang=0, int type=Up, string name="",
string val="", bool draw=true)
{
path pLine;
real platsep=1mm;
int normal=0, electrolytic=1, variable=2, variant=3;
-TwoTerminal capacitor(pair beg=(0,0), int type=normal, real ang=0,
+TwoTerminal capacitor(pair beg=(0,0), real ang=0, int type=normal,
string name="", string val="", bool draw=true)
{
path pLine[]={}, pMisc[]={};
// capacitors) are also polarized. The positioning method centerto(),
// provides enough flexibility.
-TwoTerminal diode(pair beg=(0,0), int type=normal, real ang=0, string name="",
+TwoTerminal diode(pair beg=(0,0), real ang=0, int type=normal, string name="",
string val="", bool draw=true)
{
path pLine[]={}, pMisc[]={};
/* `switch' is a Asymptote keyword (or it should be), so append SPST
* for Single Pole Single Throw.
*/
-TwoTerminal switchSPST(pair beg=(0,0), int type=NO, real ang=0, string name="",
+TwoTerminal switchSPST(pair beg=(0,0), real ang=0, int type=NO, string name="",
string val="", bool draw=true)
{
path pLine[]={}, pMisc[]={};
real ssize=6mm;
int AC=0,DC=1,I=2,V=3;
-TwoTerminal source(pair beg=(0,0), int type=AC, real ang=0, string name="",
+TwoTerminal source(pair beg=(0,0), real ang=0, int type=AC, string name="",
string val="", bool draw=true)
{
path pLine[]={}, pMisc[]={};