2 * Generates the repetitive part of the gnuplot input
3 * for generating the initial triangle vertices from SGT's
10 int main(int argc, const char **argv) {
11 static const int prec= DBL_DIG+2;
14 if (argc!=1) { fputs("need no args\n",stderr); exit(8); }
16 printf("%d %d %d %d %d\n%%-%d.%dg\n",
20 FOR_VERTEX(vi, INNER) {
21 int x= vi & XMASK; /* distance along strip */
22 int y= vi >> YSHIFT; /* distance across strip */
23 double u= y * 1.0 / (Y-1); /* SGT's u runs 0..1 across the strip */
25 /* SGT's v runs 0..pi along the strip, where the join is at 0==pi.
26 * So that corresponds to 0..X (since 0==X in our scheme).
27 * Vertices with odd y coordinate are halfway to the next x coordinate.
29 double v= (x*2 + (y&1)) * 1.0 / (X*2);
33 printf("%-*.*g %-*.*g # %03x %2d %2d\n",
34 prec+5,prec,u, prec+5,prec,v,