X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=primer.c;h=76939a6356b9911dc59e29913603cf8af5ee671b;hb=9e8860ae32184285e451568d39df79baf7f44aff;hp=1f87036119b45ac54d2fc254276031e727290b96;hpb=04d38304c34c5cac06e7fed4c20e3fe108330b7b;p=moebius2.git diff --git a/primer.c b/primer.c index 1f87036..76939a6 100644 --- a/primer.c +++ b/primer.c @@ -14,10 +14,10 @@ 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) { + FOR_VERTEX(vi, INNER) { int x= vi & XMASK; /* distance along strip */ int y= vi >> YSHIFT; /* distance across strip */ double u= y * 1.0 / (Y-1); /* SGT's u runs 0..1 across the strip */ @@ -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,