From 1458929a5d7620a0f1a5db4a266e5c4ce8af1a0b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 2 Oct 2021 19:49:29 +0200 Subject: [PATCH] clearer functions bt::bt_to_minkowski and bt::minkowski_to_bt --- binary-tiling.cpp | 20 ++++++++++++++++++-- reg3.cpp | 6 ++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/binary-tiling.cpp b/binary-tiling.cpp index 9b31b67c..5cf619d3 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -827,6 +827,7 @@ EX namespace bt { return log(2) + log(-h[0]); } + /** you probably want minkowski_to_bt */ EX hyperpoint deparabolic3(hyperpoint h) { h /= (1 + h[3]); hyperpoint one = point3(1,0,0); @@ -837,6 +838,22 @@ EX namespace bt { return point3(log(2) + log(-h[0]), h[1] / co, h[2] / co); } + /** \brief convert BT coordinates to Minkowski coordinates + in the BT coordinates, h[2] is vertical; the center of the horosphere in Klein model is (1,0,0) + */ + + EX hyperpoint bt_to_minkowski(hyperpoint h) { + ld yy = log(2) / 2; + return parabolic3(h[0], h[1]) * xpush0(yy*h[2]); + } + + /** \brief inverse of bt_to_minkowski */ + EX hyperpoint minkowski_to_bt(hyperpoint h) { + h = bt::deparabolic3(h); + h = point3(h[1], h[2], h[0] / (log(2)/2)); + return h; + } + #if CAP_COMMANDLINE auto bt_config = arg::add2("-btwidth", [] {arg::shift_arg_formula(vid.binary_width); }); #endif @@ -1177,8 +1194,7 @@ EX void create_faces() { if(kite::in()) { auto kv = kite::make_walls(); for(auto& v: kv.first) for(auto& h: v) { - h = bt::deparabolic3(h); - h = point3(h[1], h[2], h[0] / (log(2)/2)); + h = minkowski_to_bt(h); } for(int i=0; i