chiark
/
gitweb
/
~ian
/
moebius2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add nprocessors utility
[moebius2.git]
/
primer.c
diff --git
a/primer.c
b/primer.c
index f023b10365881f25c3de3f4e7b9a23e3bc2c4586..70cbcfeda45883205414c05c6b285df43fbb790c 100644
(file)
--- a/
primer.c
+++ b/
primer.c
@@
-9,12
+9,14
@@
int main(int argc, const char **argv) {
static const int prec= DBL_DIG+2;
int main(int argc, const char **argv) {
static const int prec= DBL_DIG+2;
- int vi
, k
;
+ int vi;
- if (argc>1) { fputs("no args please\n",stderr); exit(8); }
+ if (argc!=1) { fputs("need no args\n",stderr); exit(8); }
+
+ printf("%d %d %d %d %d\n%%-%d.%dg\n",
+ X*Y, N, X, Y, D3,
+ prec+5,prec);
- printf("print %d, %d, %d, %d, %d\n", DIM, N, X, Y, D3);
-
FOR_VERTEX(vi) {
int x= vi & XMASK; /* distance along strip */
int y= vi >> YSHIFT; /* distance across strip */
FOR_VERTEX(vi) {
int x= vi & XMASK; /* distance along strip */
int y= vi >> YSHIFT; /* distance across strip */
@@
-24,12
+26,13
@@
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.
*/
* 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;
- K printf("print %c%c( %-*.*g, %-*.*g); # %03x %2d %2d\n",
- "+-+"[k], "xyz"[k],
- prec+5,prec,u, prec+5,prec,v,
- vi, x, y);
+ printf("%-*.*g %-*.*g # %03x %2d %2d\n",
+ prec+5,prec,u, prec+5,prec,v,
+ vi, x, y);
}
flushoutput();
return 0;
}
flushoutput();
return 0;