mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-05-18 04:02:07 +00:00
Updated to 8.3j
This commit is contained in:
+23
-5
@@ -1,18 +1,31 @@
|
||||
// Hyperbolic Rogue
|
||||
// Copyright (C) 2011-2012 Zeno Rogue, see 'hyper.cpp' for details
|
||||
|
||||
// geometrical constants
|
||||
|
||||
ld tessf, crossf, hexf;
|
||||
// Copyright (C) 2011-2012 Zeno Rogue, see 'hyper.cpp' for details
|
||||
|
||||
|
||||
ld tessf, crossf, hexf, hcrossf;
|
||||
|
||||
// tessf: distance from heptagon center to another heptagon center
|
||||
// hexf: distance from heptagon center to heptagon vertex
|
||||
// crossf: distance from heptagon center to adjacent hexagon center
|
||||
|
||||
#define ALPHA (M_PI*2/7)
|
||||
|
||||
hyperpoint Crad[42];
|
||||
|
||||
transmatrix heptmove[7], hexmove[7];
|
||||
transmatrix invheptmove[7], invhexmove[7];
|
||||
|
||||
// the results are:
|
||||
// hexf = 0.378077 hcrossf = 0.620672 tessf = 1.090550
|
||||
|
||||
void precalc() {
|
||||
|
||||
DEBB(DF_INIT, (debugfile,"precalc\n"));
|
||||
|
||||
if(euclid) return;
|
||||
|
||||
ld fmin = 1, fmax = 2;
|
||||
|
||||
for(int p=0; p<100; p++) {
|
||||
@@ -30,7 +43,8 @@ void precalc() {
|
||||
ld v1 = intval(H, C0), v2 = intval(H, xpush(tessf) * C0);
|
||||
if(v1 < v2) fmin = f; else fmax = f;
|
||||
}
|
||||
crossf = fmin;
|
||||
hcrossf = fmin;
|
||||
crossf = purehepta ? tessf : hcrossf;
|
||||
|
||||
fmin = 0, fmax = tessf;
|
||||
for(int p=0; p<100; p++) {
|
||||
@@ -43,13 +57,17 @@ void precalc() {
|
||||
}
|
||||
hexf = fmin;
|
||||
|
||||
// printf("hexf = %.6Lf cross = %.6Lf tessf = %.6Lf\n", hexf, crossf, tessf);
|
||||
|
||||
for(int i=0; i<42; i++)
|
||||
Crad[i] = spin(2*M_PI*i/42) * xpush(.4) * C0;
|
||||
for(int d=0; d<7; d++)
|
||||
heptmove[d] = spin(-d * ALPHA) * xpush(tessf) * spin(M_PI);
|
||||
for(int d=0; d<7; d++)
|
||||
hexmove[d] = spin(-d * ALPHA) * xpush(-crossf)* spin(M_PI);
|
||||
|
||||
|
||||
for(int d=0; d<7; d++) invheptmove[d] = inverse(heptmove[d]);
|
||||
for(int d=0; d<7; d++) invhexmove[d] = inverse(hexmove[d]);
|
||||
}
|
||||
|
||||
transmatrix ddi(ld dir, ld dist) {
|
||||
|
||||
Reference in New Issue
Block a user