13 void iso(struct hex *h) {
15 printf("iso(%d,%d,%d)", h->x, h->y, h->z);
17 void xy(struct hex *h) {
19 printf("xy(%d,%d)", h->x, h->y);
27 {5, 0.5485949, 0.1666408, "49900 Corvallis"},
28 {5, 0.5498729, 0.1533820, "42300 Aloha"},
29 {5, 0.5485337, 0.1538048, "41700 Tigard"},
30 {5, 0.5469778, 0.1653373, "41400 Albany"},
31 {5, 0.5477250, 0.1538168, "35700 LakeOswego"},
32 {5, 0.5484942, 0.1602033, "32600 Keizer"},
33 {5, 0.5514087, 0.1580878, "26800 MacMinnville"},
34 {5, 0.5463249, 0.1543639, "26100 OregonCity"},
35 {5, 0.5366604, 0.1942501, "23300 GrantsPass"},
36 {5, 0.5482398, 0.1544470, "23100 Tualatin"},
37 {5, 0.5468969, 0.1541197, "22500 WestLinn"},
38 {5, 0.5471126, 0.1531509, "20700 Milwaukie"},
39 {5, 0.5338688, 0.1458412, "20600 CitrusPark"},
40 {5, 0.5477809, 0.1577168, "20400 Woodburn"},
41 {5, 0.5415903, 0.1843270, "20300 Roseburg"},
48 char isea[64], sahr[64];
54 g.output = ISEA_PROJTRI;
55 g.radius = ISEA_SCALE;
58 while (cities[i].data) i++;
63 ll.lon = cities[j].lon * M_PI / 180.0;
64 ll.lat = cities[j].lat * M_PI / 180.0;
65 xy = isea_forward(&g, &ll);
66 sprintf(isea, "%.7f", xy.x);
67 sprintf(sahr, "%.7f", dgg[j].x);
68 ok(!strcmp(isea,sahr), "projtri X (%f, %f %s) %s != %s",
69 cities[j].lon, cities[j].lat, cities[j].data,
72 ok(!strcmp(isea,sahr), "projtri Y (%f, %f %s) %f != %f",
73 cities[j].lon, cities[j].lat, cities[j].data,
75 ok(g.triangle-1 == dgg[j].triangle,
76 "projtri T (%f, %f %s) %d != %d",
77 cities[j].lon, cities[j].lat, cities[j].data,
78 g.triangle-1, dgg[j].triangle);