diff --git a/conformal.cpp b/conformal.cpp index d82ad00c..84855549 100644 --- a/conformal.cpp +++ b/conformal.cpp @@ -534,7 +534,8 @@ namespace conformal { "disk", "half-plane", "band", "polygonal", "polynomial", "azimuthal equidistant", "azimuthal equi-area", "ball model", "Minkowski hyperboloid", "hemisphere", - "band equidistant", "band equi-area", "sinusoidal", "two-point equidistant" + "band equidistant", "band equi-area", "sinusoidal", "two-point equidistant", + "fisheye" }; string get_model_name(eModel pm) { @@ -640,6 +641,8 @@ namespace conformal { pmodel = eModel(12); else if(uni == '$') pmodel = eModel(13); + else if(uni == '%') + pmodel = eModel(14); else if(uni == '6') vid.alpha = 1, vid.scale = 1; else if(uni == 'z') diff --git a/hyper.h b/hyper.h index e9778b97..d3188fdf 100644 --- a/hyper.h +++ b/hyper.h @@ -927,6 +927,7 @@ enum eModel { mdDisk, mdHalfplane, mdBand, mdPolygonal, mdPolynomial, mdEquidistant, mdEquiarea, mdBall, mdHyperboloid, mdHemisphere, mdBandEquidistant, mdBandEquiarea, mdSinusoidal, mdTwoPoint, + mdFisheye, mdGUARD, mdUnchanged }; namespace conformal { diff --git a/hypgraph.cpp b/hypgraph.cpp index 0062fc70..68e50a60 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -222,6 +222,16 @@ void applymodel(hyperpoint H, hyperpoint& ret) { return; } + if(pmodel == mdFisheye) { + ret[0] = H[0] / tz; + ret[1] = H[1] / tz; + ld hypot = sqrt(1 + ret[0]*ret[0] + ret[1]*ret[1]); + ret[0] /= hypot; + ret[1] /= hypot; + ghcheck(ret, H); + return; + } + ld zlev = 1; bool zlev_used = false; diff --git a/polygons.cpp b/polygons.cpp index 62f363a5..eb64f65e 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -548,8 +548,10 @@ void drawpolyline(polytodraw& p) { if(abs(p[0]) > poly_limit || abs(p[1]) > poly_limit) return; // too large! } + + bool equi = mdAzimuthalEqui() || pmodel == mdFisheye; - if((spherespecial > 0 || (sphere && mdAzimuthalEqui())) && !(poly_flags & POLY_ISSIDE)) { + if((spherespecial > 0 || (sphere && equi)) && !(poly_flags & POLY_ISSIDE)) { double rarea = 0; for(int i=0; i