1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 15:40:26 +00:00

refactored binarytiling::parabolic to parabolic1 in hyperpoint

This commit is contained in:
Zeno Rogue 2018-11-25 23:36:50 +01:00
parent 8866bc889d
commit c45fa9bd9a
2 changed files with 5 additions and 2 deletions

View File

@ -148,8 +148,7 @@ namespace binary {
}
transmatrix parabolic(ld u) {
u = u * vid.binary_width / log(2);
return transmatrix {{{-u*u/8+1, u/2, u*u/8}, {-u/2, 1, u/2}, {-u*u/8, u/2, u*u/8+1}}};
return parabolic1(u * vid.binary_width / log(2) / 2);
}
void draw() {

View File

@ -319,6 +319,10 @@ transmatrix ypush(ld alpha) {
return T;
}
transmatrix parabolic1(ld u) {
return transmatrix {{{-u*u/2+1, u, u*u/2}, {-u, 1, u}, {-u*u/2, u, u*u/2+1}}};
}
// rotate the hyperbolic plane around C0 such that H[1] == 0 and H[0] >= 0
transmatrix spintox(const hyperpoint& H) {
transmatrix T = Id;