1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-28 21:41:19 +00:00

azimuthal equivolume projection

This commit is contained in:
Zeno Rogue
2019-03-30 17:45:56 +01:00
parent 99dc6b8dd7
commit 2b61413a81
6 changed files with 19 additions and 4 deletions

View File

@@ -557,7 +557,7 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
makeband(H, ret, [] (ld& x, ld& y) { x *= cos_auto(y); });
break;
case mdEquidistant: case mdEquiarea: {
case mdEquidistant: case mdEquiarea: case mdEquivolume: {
ld zlev = find_zlev(H);
ld rad = hypot_d(DIM, H);
@@ -568,7 +568,9 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
// 4 pi / 2pi = M_PI
if(pmodel == mdEquiarea && sphere)
if(pmodel == mdEquivolume)
d = pow(volume_auto(d), 1/3.) * pow(M_PI / 2, 1/3.);
else if(pmodel == mdEquiarea && sphere)
d = sqrt(2*(1 - cos(d))) * M_PI / 2;
else if(pmodel == mdEquiarea && hyperbolic)
d = sqrt(2*(cosh(d) - 1)) / 1.5;