COIN-OR::LEMON - Graph Library

Changeset 1084:320a0f083ca1 in lemon-0.x for src/lemon/bezier.h


Ignore:
Timestamp:
01/16/05 23:31:26 (15 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1480
Message:

Functions added to compute the gradient of Bezier curve.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/bezier.h

    r1073 r1084  
    2222///\brief Classes to compute with Bezier curves.
    2323///
    24 ///Up to now this file is internally used by \ref graph_to_eps.h
     24///Up to now this file is used internally by \ref graph_to_eps.h
    2525///
    2626///\author Alpar Juttner
     
    5959    return Bezier1(conv(p1,p2,t),p2);
    6060  }
    61   Bezier1 operator()(double a,double b) { return before(b).after(a/b); } 
     61  Bezier1 revert() { return Bezier1(p2,p1);}
     62  Bezier1 operator()(double a,double b) { return before(b).after(a/b); }
     63  xy grad() { return p2-p1; }
     64  xy grad(double t) { return grad(); }
     65
    6266};
    6367
     
    8892    return Bezier2(conv(q,r,t),r,p3);
    8993  }
     94  Bezier2 revert() { return Bezier2(p3,p2,p1);}
    9095  Bezier2 operator()(double a,double b) { return before(b).after(a/b); }
    91  
     96  Bezier1 grad() { return Bezier1(2.0*(p2-p1),2.0*(p3-p2)); }
     97  xy grad(double t) { return grad()(t); } 
    9298};
    9399
     
    131137      return Bezier3(c,b,r,p4);
    132138    }
     139  Bezier3 revert() { return Bezier3(p4,p3,p2,p1);}
    133140  Bezier3 operator()(double a,double b) { return before(b).after(a/b); }
    134  
     141  Bezier2 grad() { return Bezier2(3.0*(p2-p1),3.0*(p3-p2),3.0*(p4-p3)); }
     142  xy grad(double t) { return grad()(t); }
    135143};
    136144
Note: See TracChangeset for help on using the changeset viewer.