mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-10 05:28:18 +00:00
fixed some bugs in hyperpoint.cpp
This commit is contained in:
parent
7110be2032
commit
a89dc002cd
@ -447,8 +447,8 @@ void fixmatrix(transmatrix& T) {
|
|||||||
|
|
||||||
for(int z=0; z<DIM; z++) T[z][x] -= dp * T[z][y];
|
for(int z=0; z<DIM; z++) T[z][x] -= dp * T[z][y];
|
||||||
}
|
}
|
||||||
for(int x=0; x<DIM; x++) T[2][x] = 0;
|
for(int x=0; x<DIM; x++) T[DIM][x] = 0;
|
||||||
T[2][2] = 1;
|
T[DIM][DIM] = 1;
|
||||||
}
|
}
|
||||||
else for(int x=0; x<MDIM; x++) for(int y=0; y<=x; y++) {
|
else for(int x=0; x<MDIM; x++) for(int y=0; y<=x; y++) {
|
||||||
ld dp = 0;
|
ld dp = 0;
|
||||||
@ -548,8 +548,7 @@ double hdist0(const hyperpoint& mh) {
|
|||||||
if(mh[DIM] < 1) return 0;
|
if(mh[DIM] < 1) return 0;
|
||||||
return acosh(mh[DIM]);
|
return acosh(mh[DIM]);
|
||||||
case gcEuclid: {
|
case gcEuclid: {
|
||||||
ld d = sqhypot_d(mh, DIM);
|
return hypot_d(mh, DIM);
|
||||||
return d;
|
|
||||||
}
|
}
|
||||||
case gcSphere: {
|
case gcSphere: {
|
||||||
ld res = mh[DIM] >= 1 ? 0 : mh[DIM] <= -1 ? M_PI : acos(mh[DIM]);
|
ld res = mh[DIM] >= 1 ? 0 : mh[DIM] <= -1 ? M_PI : acos(mh[DIM]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user