chiark / gitweb /
compiles and most output facets are right; needs debugging
[moebius2.git] / primer.c
index 1f87036119b45ac54d2fc254276031e727290b96..70cbcfeda45883205414c05c6b285df43fbb790c 100644 (file)
--- a/primer.c
+++ b/primer.c
@@ -14,7 +14,7 @@ int main(int argc, const char **argv) {
   if (argc!=1) { fputs("need no args\n",stderr); exit(8); }
 
   printf("%d %d %d %d %d\n%%-%d.%dg\n",
-        DIM, N, X, Y, D3,
+        X*Y, N, X, Y, D3,
         prec+5,prec);
 
   FOR_VERTEX(vi) {
@@ -26,7 +26,9 @@ int main(int argc, const char **argv) {
      * So that corresponds to 0..X (since 0==X in our scheme).
      * Vertices with odd y coordinate are halfway to the next x coordinate.
      */
-    double v= (x*2 + (y&1)) * M_PI / (X*2);
+    double v= (x*2 + (y&1)) * 1.0 / (X*2);
+    v += 0.5;
+    v *= M_PI;
 
     printf("%-*.*g %-*.*g # %03x %2d %2d\n",
           prec+5,prec,u, prec+5,prec,v,