From 2b1d1890748d518abcbccb2e8c92561d7dae1e8e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 16 Jul 2018 20:06:21 +0200 Subject: [PATCH] geometry improvements --- hyper.h | 2 +- hyperpoint.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hyper.h b/hyper.h index 4c661f56..2ce2b1c2 100644 --- a/hyper.h +++ b/hyper.h @@ -213,7 +213,7 @@ namespace hyperpoint_vec { ); } - // inner product + // inner product (in R^3) inline ld operator | (hyperpoint h1, hyperpoint h2) { return h1[0] * h2[0] + h1[1] * h2[1] + h1[2] * h2[2]; } diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 2819bb8e..ff68b86a 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -403,11 +403,13 @@ transmatrix rpushxto0(const hyperpoint& H) { // generalization: H[1] can be non-zero transmatrix gpushxto0(const hyperpoint& H) { + if(euclid) return eupush(-H[0], -H[1]); hyperpoint H2 = spintox(H) * H; return rspintox(H) * pushxto0(H2) * spintox(H); } transmatrix rgpushxto0(const hyperpoint& H) { + if(euclid) return eupush(H[0], H[1]); hyperpoint H2 = spintox(H) * H; return rspintox(H) * rpushxto0(H2) * spintox(H); }