From 7e1df6d9a368954315c6116dd999695179b9fa60 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 26 Dec 2020 22:59:58 +0100 Subject: [PATCH] additional convenience functions for Euclidean translations and scaling --- hyperpoint.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 5013557f..00fab6e6 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -569,6 +569,29 @@ EX transmatrix eupush(ld x, ld y) { return T; } +EX transmatrix euclidean_translate(ld x, ld y, ld z) { + transmatrix T = Id; + T[0][LDIM] = x; + T[1][LDIM] = y; + T[2][LDIM] = z; + return T; + } + +EX transmatrix euscale(ld x, ld y) { + transmatrix T = Id; + T[0][0] = x; + T[1][1] = y; + return T; + } + +EX transmatrix euscale3(ld x, ld y, ld z) { + transmatrix T = Id; + T[0][0] = x; + T[1][1] = y; + T[2][2] = z; + return T; + } + EX transmatrix eupush(hyperpoint h, ld co IS(1)) { if(nonisotropic) return nisot::translate(h, co); transmatrix T = Id;