#include <2geom/d2.h> #include <2geom/sbasis.h> #include <2geom/bezier-to-sbasis.h> #include #include #include using std::vector; using namespace Geom; using namespace std; static void plot(cairo_t* cr, SBasis const &B,double vscale=1,double a=0,double b=1){ D2 plot; plot[0]=SBasis(Linear(150+a*300,150+b*300)); plot[1]=B*-vscale; plot[1]+=450; cairo_d2_sb(cr, plot); cairo_stroke(cr); } static void plot(cairo_t* cr, Piecewise const &f,double vscale=1){ for (unsigned i=0;i g=pw_inverse(f,3); cairo_set_line_width (cr, 1); cairo_set_source_rgba (cr, 0.8, 0., 0., 1); plot(cr,g,300); Piecewise h=compose(g,f); cairo_set_line_width (cr, 1); cairo_set_source_rgba (cr, 0., 0.8, 0., 1); plot(cr,h,300); *notify<