summaryrefslogtreecommitdiffstats
path: root/src/2geom/sbasis.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-05-10 20:20:11 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-05-10 20:20:11 +0000
commit711043c7ca9bd675133e9bb1c1a3ec05c83cbeba (patch)
tree9395fdf4cc57a8192fc0ebe506dd0f5b9db0d9d3 /src/2geom/sbasis.cpp
parentDo not show/edit image URL for data URIs. (diff)
downloadinkscape-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.cpp22
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());