Logo Search packages:      
Sourcecode: inkscape version File versions

Piecewise< SBasis > Geom::sqrt ( Piecewise< SBasis > const &  f,
double  tol,
int  order 
)

Compute the sqrt of a function.

Parameters:
f function

Definition at line 189 of file sbasis-math.cpp.

References Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::domain(), max(), Geom::Piecewise< T >::segs, Geom::Piecewise< T >::setDomain(), and Geom::Piecewise< T >::size().

                                                                         {
    Piecewise<SBasis> result;
    Piecewise<SBasis> zero = Piecewise<SBasis>(Linear(tol*tol));
    zero.setDomain(f.domain());
    Piecewise<SBasis> ff=max(f,zero);

    for (unsigned i=0; i<ff.size(); i++){
        Piecewise<SBasis> sqrtfi = sqrt_internal(ff.segs[i],tol,order);
        sqrtfi.setDomain(Interval(ff.cuts[i],ff.cuts[i+1]));
        result.concat(sqrtfi);
    }
    return result;
}


Generated by  Doxygen 1.6.0   Back to index