/[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.28 by tjl, Thu Oct 3 11:23:36 2002 UTC revision 1.29 by tjl, Thu Oct 3 12:12:53 2002 UTC
# Line 4  Line 4 
4    
5  namespace Coords {  namespace Coords {
6      DBGVAR(dbg, "Coords.general");      DBGVAR(dbg, "Coords.general");
7        DBGVAR(dbg_buoy, "Coords.buoy");
8    
9      // The (STL-like) concept of transform:      // The (STL-like) concept of transform:
10      // enum { NParams = n };      // enum { NParams = n };
# Line 298  namespace Coords { Line 299  namespace Coords {
299              float c = amc.dot(amc) - radius*radius;              float c = amc.dot(amc) - radius*radius;
300    
301              float det = b*b - 4*a*c;              float det = b*b - 4*a*c;
302    
303                DBG(dbg_buoy) << "eq: "<<anchor<<" "<<amc<<" "<<v<<" "<<a<<" "<<b<<" "<<c<<"\n";
304    
305              if(det <= 0) {              if(det <= 0) {
306                  tr = ZVec(0,0,0);                  tr = ZVec(0,0,0);
307                    DBG(dbg_buoy) << "No solution - zero\n";
308                  return;                  return;
309              }              }
310              float ans = (-b + sqrt(det)) / (2*a);              float ans = (-b + sqrt(det)) / (2*a);
311              ZPt pt = proj + ans * v;              ZPt pt = proj + ans * v;
312    
313                DBG(dbg_buoy) << "solution: "<<pt<<"\n";
314              tr = pt;              tr = pt;
315          }          }
316          virtual CoordSys *createInverse() {          virtual CoordSys *createInverse() {

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

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