1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-19 19:54:47 +00:00

fixed scale_at for cylindrical projections

This commit is contained in:
Zeno Rogue 2022-03-27 09:04:05 +02:00
parent 930e0c6830
commit 8e710784df

View File

@ -789,6 +789,15 @@ EX ld scale_at(const shiftmatrix& T) {
applymodel(tC0(T), h1);
applymodel(T * xpush0(.01), h2);
applymodel(T * ypush(.01) * C0, h3);
if(mdBandAny()) {
ld x2 = 2;
if(pmodel == mdBandEquiarea) x2 /= 2;
ld x4 = 2 * x2;
if(h2[0] > h1[0] + x2) h2[0] -= x4;
if(h2[0] < h1[0] - x2) h2[0] += x4;
if(h3[0] > h1[0] + x2) h3[0] -= x4;
if(h3[0] < h1[0] - x2) h3[0] += x4;
}
return sqrt(hypot_d(2, h2-h1) * hypot_d(2, h3-h1) / .0001);
}