Logo Search packages:      
Sourcecode: inkscape version File versions

SBasis Geom::integral ( SBasis const &  c  ) 

Compute the integral of a (Exact)

Parameters:
a sbasis functions
Returns:
sbasis integral(a)

Definition at line 294 of file sbasis.cpp.

                                 {
    SBasis a;
    a.resize(c.size() + 1, Linear(0,0));
    a[0] = Linear(0,0);

    for(unsigned k = 1; k < c.size() + 1; k++) {
        double ahat = -c[k-1].tri()/(2*k);
        a[k][0] = a[k][1] = ahat;
    }
    double aTri = 0;
    for(int k = c.size()-1; k >= 0; k--) {
        aTri = (c[k].hat() + (k+1)*aTri/2)/(2*k+1);
        a[k][0] -= aTri/2;
        a[k][1] += aTri/2;
    }
    a.normalize();
    return a;
}


Generated by  Doxygen 1.6.0   Back to index