From a264723b23d9ad6c3cb13450a6cf4b131f8d7338 Mon Sep 17 00:00:00 2001 From: pants Date: Thu, 8 Sep 2016 11:46:00 -0400 Subject: fixed some problems with square networks --- src/geometry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/geometry.c') diff --git a/src/geometry.c b/src/geometry.c index 83ef0bf..ec788f1 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -43,9 +43,9 @@ double dual_vert_to_coord(unsigned int width, bool periodic, unsigned int vert, bool index) { if (periodic) { if (index) - return vert % (width / 2) + (vert / (width / 2)) % 2; + return (2 * vert) % width + (2 * vert / width) % 2; else - return vert / (width / 2); + return 2 * vert / width; } else { if (index) return (2 * vert) % (width + 1); -- cgit v1.2.3-70-g09d2