1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-14 20:57:10 +00:00

embeddings:: simplifications

This commit is contained in:
Zeno Rogue
2023-02-04 10:18:01 +01:00
parent 32491d6425
commit a14bceb681
4 changed files with 24 additions and 7 deletions

View File

@@ -1307,7 +1307,6 @@ EX hyperpoint scale_point(const hyperpoint& h, ld scale_factor) {
}
EX transmatrix orthogonal_move(const transmatrix& t, double level) {
if(gproduct && !cgi.emb->is_euc_in_product()) return scale_matrix(t, exp(level));
if(GDIM == 3) return t * lzpush(level);
return scale_matrix(t, geom3::lev_to_factor(level));
}
@@ -1316,6 +1315,12 @@ EX shiftmatrix orthogonal_move(const shiftmatrix& t, double level) {
return shiftless(orthogonal_move(t.T, level), t.shift);
}
/** fix a 3x3 matrix into a 4x4 matrix */
EX transmatrix fix4(transmatrix t) {
for(int i=0; i<4; i++) t[3][i] = t[i][3] = i == 3;
return t;
}
EX transmatrix xyscale(const transmatrix& t, double fac) {
transmatrix res;
for(int i=0; i<MXDIM; i++) {