7 void iso(struct hex *h) {
9 printf("iso(%d,%d,%d)", h->x, h->y, h->z);
11 void xy(struct hex *h) {
13 printf("xy(%d,%d)", h->x, h->y);
22 hexbin2(0, 1.0, 0.0, 0.0, &x, &y);
23 ok(x == 0 && y == 0, "0.0 0.0 -> 0 0");
25 hexbin2(0, 0.1111111, 0.288675, 0.500000, &x, &y);
26 ok(x == 3, "center bin X %d == 3", x);
27 ok(y == -5, "center bin Y %d == -5", y);
29 hexbin2(0, 0.1111111, 0.866025, 0.500000, &x, &y);
30 ok(x == 9, "vertex bin X %d == 9", x);
31 ok(y == -5, "vertex bin Y %d == -5", y);
35 for (p = -4.0; p < 4.0; p+= 0.4) {
36 for (q = -4.0; q < 4.0; q += 0.4) {
37 hexbin2(0, 1.0, p, q, &x, &y);
38 printf("(%f, %f) = %d %d\n", p, q, x, y);