Index: trunk/psastro/src/psastroLoadGlints.c
===================================================================
--- trunk/psastro/src/psastroLoadGlints.c	(revision 40552)
+++ trunk/psastro/src/psastroLoadGlints.c	(revision 41290)
@@ -364,15 +364,12 @@
 	      if (star_radius_deg < 0.8831) {
 		outer_edge_angle = 0.0;
-	      }
-	      else if (star_radius_deg < 0.9368) {
+	      } else if (star_radius_deg < 0.9368) {
 		outer_edge_angle = 46.2985 * sqrt(star_radius_deg - 0.8831);
-	      }
-	      else {
+	      } else {
 		outer_edge_angle = -2.67 + 14.3 * star_radius_deg;
 	      }
 	      if (star_radius_deg < 0.964) {
 		inner_edge_angle = -243.866 * pow(star_radius_deg - 0.932,2) + 2.4636;
-	      }
-	      else {
+	      } else {
 		inner_edge_angle = 66.2061 * sqrt(star_radius_deg - 0.9635);
 	      }
@@ -383,7 +380,7 @@
 	      // These define the ends of a single arc in arc-centric coordinates
 	      double x1 = C - R * cos(inner_edge_angle);
-	      double y1 = R * sin(inner_edge_angle);
+	      double y1 =     R * sin(inner_edge_angle);
 	      double x2 = C - R * cos(outer_edge_angle);
-	      double y2 = R * sin(outer_edge_angle);
+	      double y2 =     R * sin(outer_edge_angle);
 
 	      // Create the endpoints for the pair of arcs in device coordinates (in millimeters)
@@ -414,5 +411,9 @@
 		      x2s,y2s,x2e,y2e);
 		      
-	      
+	      // NOTE: the calculations below appear to expect (x1s, y1s) in millimeters, as mentioned above.
+	      // They are then scaled to camera pixel units using 0.015 millimeters / pixel, and then to
+	      // TPA units using 13.5 pixels / pixel.  I do not know where the (12.78, 57.75) mm offsets
+	      // come from (displacement of reference chip?)
+		
 	      tp->x = 13.5 * (y1s / 0.015 + 12.78);
 	      tp->y = 13.5 * (x1s / -0.015 + 57.74);
@@ -420,6 +421,4 @@
 	      x_start->data.F32[0] = fp->x;
 	      y_start->data.F32[0] = fp->y;
-	      //	      x_start->data.F32[0] = tp->x;
-	      //	      y_start->data.F32[0] = tp->y;
 
 	      tp->x = 13.5 * (y1e / 0.015 + 12.78);
@@ -428,6 +427,4 @@
 	      x_end->data.F32[0]   = fp->x;
 	      y_end->data.F32[0]   = fp->y;
-	      //	      x_end->data.F32[0]   = tp->x;
-	      //	      y_end->data.F32[0]   = tp->y;
 
 	      x_start->data.F32[1] = x_end->data.F32[0];  
@@ -441,6 +438,4 @@
 	      x_start->data.F32[2] = fp->x;
 	      y_start->data.F32[2] = fp->y;
-	      //	      x_start->data.F32[2] = tp->x;
-	      //	      y_start->data.F32[2] = tp->y;
 
 	      tp->x = 13.5 * (y2e / 0.015 + 12.78);
@@ -449,6 +444,4 @@
 	      x_end->data.F32[2]   = fp->x;
 	      y_end->data.F32[2]   = fp->y;
-	      //	      x_end->data.F32[2]   = tp->x;
-	      //	      y_end->data.F32[2]   = tp->y;
 	      
 	      x_start->data.F32[3] = x_end->data.F32[2];  
