X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=mgraph.h;h=08704894f7ab41841f11f44937a981f26c588a75;hb=251e54ceafbd572cf2a3e9c70c5f5db07794f7c6;hp=3995d463ed0bda1160791fa997d2da40fde6ea66;hpb=456ce271eea85ff5acfe6a4416fa6c085d998c64;p=moebius2.git diff --git a/mgraph.h b/mgraph.h index 3995d46..0870489 100644 --- a/mgraph.h +++ b/mgraph.h @@ -4,16 +4,16 @@ /* * Vertices in strip are numbered as follows: * - * ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 ___ 4 __ - * Y-1 Y-1 0 0 0 0 0 + * ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 ___ 4 __ + * Y-1 Y-1 0 0 0 0 0 * / \ / \ / \ / \ / \ / \ / \ * / \ / \ / \ / \ / \ / \ / \ - * X-3 ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 ___ 4 - * Y-2 Y-2 Y-2 1 1 1 1 1 + * X-3 ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 ___ 4 + * Y-2 Y-2 Y-2 1 1 1 1 1 * \ / \ / \ / \ / \ / \ / \ / * \ / \ / \ / \ / \ / \ / \ / - * ___ X-3 ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 __ - * Y-3 Y-3 Y-3 2 2 2 2 + * ___ X-3 ___ X-2 ___ X-1 ___ 0 ___ 1 ___ 2 ___ 3 __ + * Y-3 Y-3 Y-3 2 2 2 2 * * . . . . . . . . . . . . . . . * @@ -33,14 +33,24 @@ * Y must be even. The actual location opposite (0,0) is (X-(Y-1)/2,0), * and likewise opposite (0,Y-1) is ((Y-1)/2,0). * - * We label edges as follows: + * Note that though presentation above is equilateral triangles, this + * is not the case. It's actually a square lattice with half of the + * diagonals added. We can't straighten it out because at the join + * the diagonals point the other way! * - * e: \2 /1 - * \ / - * ___ 0 __ - * 3 1 0 - * / \ - * 4/ 5\ + * We label edges as follows: Or in the square view: + * + * \2 /1 2 1 + * \ / | / + * ___ 0 __ |/ + * 3 1 0 3--*--0 + * / \ /| + * 4/ 5\ / | + * 4 5 + * + * (This makes the numbering + * discontinuity, at the join, + * vertical and thus tractable.) */ #ifndef MGRAPH_H @@ -48,9 +58,11 @@ #include "common.h" -#define XBITS 4 +#define DIMBITS 5 + +#define XBITS DIMBITS #define X (1<