summaryrefslogtreecommitdiffstats
path: root/src/2geom/sbasis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/2geom/sbasis.cpp')
-rw-r--r--src/2geom/sbasis.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/2geom/sbasis.cpp b/src/2geom/sbasis.cpp
index b56e03c74..4f1df621e 100644
--- a/src/2geom/sbasis.cpp
+++ b/src/2geom/sbasis.cpp
@@ -466,6 +466,15 @@ SBasis compose(SBasis const &a, SBasis const &b, unsigned k) {
return r;
}
+SBasis portion(const SBasis &t, double from, double to) {
+ double fv = t.valueAt(from);
+ double tv = t.valueAt(to);
+ SBasis ret = compose(t, Linear(from, to));
+ ret.at0() = fv;
+ ret.at1() = tv;
+ return ret;
+}
+
/*
Inversion algorithm. The notation is certainly very misleading. The
pseudocode should say:
@@ -632,7 +641,6 @@ SBasis compose_inverse(SBasis const &f, SBasis const &g, unsigned order, double
//TODO: handle det~0!!
if (fabs(det)<zero){
- det = zero;
a=b=0;
}else{
a=( q01*r10-q10*r01)/det;