mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-23 22:40:08 +00:00
added some more useful math constants to hyperpoint.cpp
This commit is contained in:
parent
cad1bccd1a
commit
0446e25ebf
@ -951,7 +951,7 @@ EX void check_cgi() {
|
|||||||
for(auto& t: cgis) timestamps.emplace_back(-t.second.timestamp, t.first);
|
for(auto& t: cgis) timestamps.emplace_back(-t.second.timestamp, t.first);
|
||||||
sort(timestamps.begin(), timestamps.end());
|
sort(timestamps.begin(), timestamps.end());
|
||||||
while(isize(timestamps) > 4) {
|
while(isize(timestamps) > 4) {
|
||||||
println(hlog, "erasing geometry ", timestamps.back().second);
|
DEBB(DF_GEOM, ("erasing geometry ", timestamps.back().second));
|
||||||
cgis.erase(timestamps.back().second);
|
cgis.erase(timestamps.back().second);
|
||||||
timestamps.pop_back();
|
timestamps.pop_back();
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,11 @@
|
|||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
#if HDR
|
#if HDR
|
||||||
|
constexpr ld full_circle = 2 * M_PI;
|
||||||
|
constexpr ld quarter_circle = M_PI / 2;
|
||||||
static const ld degree = M_PI / 180;
|
static const ld degree = M_PI / 180;
|
||||||
|
constexpr ld golden_phi = (sqrt(5)+1)/2;
|
||||||
|
constexpr ld log_golden_phi = log(golden_phi);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eGeometry geometry;
|
eGeometry geometry;
|
||||||
|
2
kite.cpp
2
kite.cpp
@ -50,7 +50,7 @@ hyperpoint mhpxy(ld x, ld y) {
|
|||||||
else return bt::parabolic3(x, y) * C0;
|
else return bt::parabolic3(x, y) * C0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ld phi = (1 + sqrt(5)) / 2;
|
const ld phi = golden_phi;
|
||||||
const ld rphi = 1 / phi;
|
const ld rphi = 1 / phi;
|
||||||
|
|
||||||
const ld down = 1 / tan(36 * degree);
|
const ld down = 1 / tan(36 * degree);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user