/[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.30 by tjl, Thu Oct 3 16:50:30 2002 UTC revision 1.31 by tjl, Fri Oct 4 06:54:11 2002 UTC
# Line 502  namespace Coords { Line 502  namespace Coords {
502          bool performGL() { return false; }          bool performGL() { return false; }
503    
504          float nonlinearity(const ZPt &p, float radius) {          float nonlinearity(const ZPt &p, float radius) {
505                float magfact = 10 * (mmax/mmin-1);
506                float clampmagfact = magfact > 1 ? 1 : magfact;
507    
508              float wh = 0.5*(w+h);              float wh = 0.5*(w+h);
509              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;
             if(dist < 0) dist = 0;  
510              if(!finite(dist)) return 1;              if(!finite(dist)) return 1;
511              return 1 + 10 / (dist + 1);              if(dist < 0) dist = 0;
512    
513                float nonl_at_zero = clampmagfact * 12;
514    
515                float half_dist = 1.5;
516                return nonl_at_zero * half_dist / (dist + half_dist);
517          }          }
518      };      };
519    

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

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