/[gzz]/gzz/gfx/libcoords/Coords.cxx
ViewVC logotype

Diff of /gzz/gfx/libcoords/Coords.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by tjl, Wed Oct 2 06:50:21 2002 UTC revision 1.27 by tjl, Wed Oct 2 13:24:15 2002 UTC
# Line 62  namespace Coords { Line 62  namespace Coords {
62          }          }
63    
64          virtual float nonlinearity(const ZPt &p, float radius) {          virtual float nonlinearity(const ZPt &p, float radius) {
65                radius = fabs(radius);
66              ZPt mp;              ZPt mp;
67              t.tr(p, mp);              t.tr(p, mp);
68              float srad = t.tr_radius(p, radius);              float srad = fabs(t.tr_radius(p, radius));
69              float snon = super->nonlinearity(mp, srad);              float snon = super->nonlinearity(mp, srad);
70              // Multiply to take into account shrinking / magnifying.              // Multiply to take into account shrinking / magnifying.
71              snon *= srad / radius;              snon *= (srad+0.000001) / (radius+0.00001);
72              float non = t.nonlinearity(p, radius);              float non = t.nonlinearity(p, radius);
73              return (non > snon ? non : snon);              return (non > snon ? non : snon);
74          }          }
# Line 382  namespace Coords { Line 383  namespace Coords {
383              float wh = 0.5*(w+h);              float wh = 0.5*(w+h);
384              float dist = hypot((p.x-x)/w, (p.y-y)/h) - radius/wh;              float dist = hypot((p.x-x)/w, (p.y-y)/h) - radius/wh;
385              if(dist < 0) dist = 0;              if(dist < 0) dist = 0;
386                if(!finite(dist)) return 1;
387              return 1 + 10 / (dist + 1);              return 1 + 10 / (dist + 1);
388          }          }
389      };      };

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26