Logo Search packages:      
Sourcecode: inkscape version File versions

SBasis Geom::compose ( SBasis const &  a,
SBasis const &  b,
unsigned  k 
)

Compute a composed with b to k terms

Parameters:
a,b sbasis functions
Returns:
sbasis a(b(t))
return a0 + s(a1 + s(a2 +... where s = (1-u)u; ak =(1 - u)a^0_k + ua^1_k

Definition at line 459 of file sbasis.cpp.

References multiply_add().

                                                             {
    SBasis s = multiply((SBasis(Linear(1,1))-b), b);
    SBasis r;

    for(int i = a.size()-1; i >= 0; i--) {
        r = multiply_add(r, s, SBasis(Linear(a[i][0])) - b*a[i][0] + b*a[i][1]);
    }
    r.truncate(k);
    return r;
}


Generated by  Doxygen 1.6.0   Back to index