diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-05-10 20:20:11 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-05-10 20:20:11 +0000 |
| commit | 711043c7ca9bd675133e9bb1c1a3ec05c83cbeba (patch) | |
| tree | 9395fdf4cc57a8192fc0ebe506dd0f5b9db0d9d3 /src/2geom/sbasis.cpp | |
| parent | Do not show/edit image URL for data URIs. (diff) | |
| download | inkscape-711043c7ca9bd675133e9bb1c1a3ec05c83cbeba.tar.gz inkscape-711043c7ca9bd675133e9bb1c1a3ec05c83cbeba.zip | |
update to latest 2geom. this adds gsl dependency, doesn't seem to make inskape executable bigger
(bzr r5649)
Diffstat (limited to 'src/2geom/sbasis.cpp')
| -rw-r--r-- | src/2geom/sbasis.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/2geom/sbasis.cpp b/src/2geom/sbasis.cpp index 7157bc885..c60132043 100644 --- a/src/2geom/sbasis.cpp +++ b/src/2geom/sbasis.cpp @@ -68,6 +68,28 @@ bool SBasis::isFinite() const { return true; } +std::vector<double> SBasis::valueAndDerivatives(double t, unsigned n) const { + std::vector<double> ret; + if(n==1) { + ret.push_back(valueAt(t)); + return ret; + } + if(n==2) { + double der; + ret.push_back(valueAndDerivative(t, der)); + ret.push_back(der); + return ret; + } + SBasis tmp = *this; + while(n > 0) { + ret.push_back(tmp.valueAt(t)); + tmp = derivative(tmp); + n--; + } + return ret; +} + + SBasis operator+(const SBasis& a, const SBasis& b) { SBasis result; const unsigned out_size = std::max(a.size(), b.size()); |
