Whitespace cleanups in base_afm.asy and monte-carlo.asy.
authorW. Trevor King <wking@tremily.us>
Sun, 17 Jun 2012 20:21:24 +0000 (16:21 -0400)
committerW. Trevor King <wking@tremily.us>
Sun, 17 Jun 2012 20:21:24 +0000 (16:21 -0400)
src/figures/schematic/base_afm.asy
src/figures/schematic/monte-carlo.asy

index 935a59ca80604134dfe66f6b0898596b0920d2d4..2a58f3717d6c1aec62617f452a22ae836535ac9a 100644 (file)
@@ -11,7 +11,7 @@ struct Cantilever {
 
   pair uty;          // unit vector pointing distally at the tip
   pair utx;          // unit vector pointing tip-side at the tip
-  
+
   pair base;         // location of the cantilever base (chip attachment point)
 
   pair uy;           // unit vector pointing distally at the base
@@ -24,7 +24,7 @@ struct Cantilever {
   real theta;        // in radians
   real r_curve;
 
-  
+
   void align_tip(pair tip) {
     // shift the whole cantilever setup so the tip rests on TIP.
     pair offset = tip - this.tip;
@@ -69,8 +69,8 @@ struct Cantilever {
     } else {
       real first_order_theta = 2.0*dx/this.arm_length;
       this.theta = newton(this.dx_error, this.dx_prime,
-                         0.1 * first_order_theta,
-                         min(3.0 * first_order_theta, pi/2.0));
+                          0.1 * first_order_theta,
+                          min(3.0 * first_order_theta, pi/2.0));
       /* because we ignored tip_height when we calculated theta, cheat a
        * bit and pretend the tip is directly under our caculated
        * tip_top.  Then adjust tip_top accordingly.  This throws off the
@@ -153,8 +153,8 @@ struct Substrate {
       real arrow_length = this.piezo_height/3;
       pair arrow_center = piezo_bot + (0, arrow_length/2 + 2pt);
       arrow(b=arrow_center + dir*arrow_length/2, dir=-dir,
-           length=this.piezo_height/3, Arrow(size=8pt),
-           margin=NoMargin, L="");
+            length=this.piezo_height/3, Arrow(size=8pt),
+            margin=NoMargin, L="");
     }
   }
 
@@ -167,13 +167,13 @@ struct Photodiode {
   pair center;
   real radius = 8pt;
   real x_scale = 0.5;
-  
+
   void draw(pen fillpen=grey, pen drawpen=defaultpen) {
     pair c = this.center;
     pair y = (0, this.radius);
     pair x = (this.x_scale*this.radius, 0);
     filldraw(shift(this.center)*xscale(this.x_scale)*scale(this.radius)
-            *unitcircle, fillpen, drawpen);
+             *unitcircle, fillpen, drawpen);
     draw((c-x)--(c+x)--c--(c-y)--(c+y), drawpen);
   }
 
@@ -211,8 +211,8 @@ struct Laser {
     // find direction of reflection post-cantilever
     pair post_dir = reflect((0,0), this.cantilever.uty)*dir;
     pair contact = extension(ref, ref+post_dir,
-                            this.photodiode.center,
-                            this.photodiode.center+N);
+                             this.photodiode.center,
+                             this.photodiode.center+N);
     real contact_width = this.width; ///length(ref-this.start)*length(ref-contact);
     pair cw = scale(contact_width)*rotate(90)*post_dir;
     if (dot(cw, rw) < 0) cw = -cw; // ensure similar direction
@@ -223,7 +223,7 @@ struct Laser {
   }
 
   void operator init(pair start, pair dir=S, Cantilever cantilever,
-                    Photodiode photodiode) {
+                     Photodiode photodiode) {
     this.start = start;
     this.dir = unit(dir);
     this.cantilever = cantilever;
index 2d14fc892fa33d2e04ae8ba414f1b5ee052b36c4..d696090c198a25d0c1a73b47d217c9cca64201b2 100644 (file)
@@ -60,7 +60,7 @@ struct Die {
   triple up = (0, 1, 0.4); // up, but tilted out of the page
   real theta = -20;
   pair[][] pips;
-  
+
   int right() {
     /* It is traditional to combine pairs of numbers that total seven
      * to opposite faces; this implies that at one vertex the faces 1,
@@ -130,12 +130,12 @@ struct Die {
     for (int i=0; i < length(face_coords); ++i) {
       p = this.transform(point(face_coords, i), face_x, face_y);
       if (i == 0) {
-       g = g--p;
+        g = g--p;
       } else {
-       c = controlSpecifier(face_coords, i-1); // {outgoing, incoming)
-       c[0] = this.transform(c[0], face_x, face_y);
-       c[1] = this.transform(c[1], face_x, face_y);
-       g = g..controls c[0] and c[1]..p;
+        c = controlSpecifier(face_coords, i-1); // {outgoing, incoming)
+        c[0] = this.transform(c[0], face_x, face_y);
+        c[1] = this.transform(c[1], face_x, face_y);
+        g = g..controls c[0] and c[1]..p;
       }
     }
     if (cyclic(face_coords)) {
@@ -149,7 +149,7 @@ struct Die {
 
   void draw_pip(pair z, triple face_x, triple face_y) {
     fill(this.transform(shift(z)*scale(this.dot_ratio/2.0)*unitcircle,
-                       face_x, face_y));
+                            face_x, face_y));
   }
 
   /* azimuth = 0, elevation=90  ->  facing up
@@ -158,7 +158,7 @@ struct Die {
    */
   void draw_face(int number, triple face_x, triple face_y) {
     filldraw(this.transform(shift((-0.5,-0.5))*unitsquare, face_x, face_y),
-            white);
+             white);
     for (pair z : this.pips[number])
       this.draw_pip(z, face_x, face_y);
   }
@@ -178,10 +178,10 @@ struct Die {
 }
 
 Door L = Door((-2cm,0),
-             L=minipage("\centering{\Large Unfold}\\$P=0.\bar{3}$\\(\epsdice{1}\epsdice{2})"));
+              L=minipage("\centering{\Large Unfold}\\$P=0.\bar{3}$\\(\epsdice{1}\epsdice{2})"));
 Door R = Door((2cm,0),
-             L=minipage("\centering{\Large Stay folded}\\$Q=1-P$\\(\epsdice{3}\epsdice{4}\epsdice{5}\epsdice{6})"),
-             angle=30);
+              L=minipage("\centering{\Large Stay folded}\\$Q=1-P$\\(\epsdice{3}\epsdice{4}\epsdice{5}\epsdice{6})"),
+              angle=30);
 Die d = Die((-0.3cm, -2.5cm), top=3, left=5);
 
 L.draw();