From 5ae2714e37deaf9d0f5fcbc306e4d5dc0c46ea98 Mon Sep 17 00:00:00 2001 From: ? Date: Mon, 25 Feb 2019 14:50:39 +0100 Subject: [PATCH] C0 and Cx1 now changes depending on DIM --- hyper.h | 4 +++- hyperpoint.cpp | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hyper.h b/hyper.h index e5a98f99..4d736925 100644 --- a/hyper.h +++ b/hyper.h @@ -3180,7 +3180,9 @@ extern ld backbrightness; void initcells(); void precalc(); -extern const hyperpoint C0; +extern const hyperpoint C02, C03; + +#define C0 (DIM == 2 ? C02 : C03) extern long long circlesize[100], disksize[100]; extern ld circlesizeD[10000]; diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 97ed295b..fc7d37ad 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -128,13 +128,17 @@ hyperpoint hpxy3(ld x, ld y, ld z) { } // center of the pseudosphere -const hyperpoint Hypc = hpxyz(0,0,0); +const hyperpoint Hypc = hyperpoint(0,0,0,0); // origin of the hyperbolic plane -const hyperpoint C0 = hpxyz(0,0,1); +const hyperpoint C02 = hyperpoint(0,0,1,0); +const hyperpoint C03 = hyperpoint(0,0,0,1); // a point (I hope this number needs no comments ;) ) -const hyperpoint Cx1 = hpxyz(1,0,1.41421356237); +const hyperpoint Cx12 = hyperpoint(1,0,1.41421356237,0); +const hyperpoint Cx13 = hyperpoint(1,0,0,1.41421356237); + +#define Cx1 (DIM==2?Cx12:Cx13) // this function returns approximate square of distance between two points // (in the spherical analogy, this would be the distance in the 3D space,