diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2018-10-01 23:21:40 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2018-10-01 23:21:40 +0000 |
| commit | 33cd18d64ea3a67b90aa87b225b0d18447f01138 (patch) | |
| tree | 7e404a57fa4b7a8b10825c2f26741c90f89f7c5c /src/2geom/sbasis-geometric.cpp | |
| parent | Avoid duplicating defines in config.h and on command line (diff) | |
| download | inkscape-33cd18d64ea3a67b90aa87b225b0d18447f01138.tar.gz inkscape-33cd18d64ea3a67b90aa87b225b0d18447f01138.zip | |
2geom: update to c709d6b6780098d3e53363d925f7aee3c2640478
Update README and remove obsolete files
Diffstat (limited to 'src/2geom/sbasis-geometric.cpp')
| -rw-r--r-- | src/2geom/sbasis-geometric.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/2geom/sbasis-geometric.cpp b/src/2geom/sbasis-geometric.cpp index 3fe27748e..275b09620 100644 --- a/src/2geom/sbasis-geometric.cpp +++ b/src/2geom/sbasis-geometric.cpp @@ -227,9 +227,9 @@ Geom::unitVector(D2<SBasis> const &V_in, double tol, unsigned order){ // -This approach is numerically bad. Find a stable way to rescale V_in to have non vanishing ends. // -This done, unitVector will have jumps at zeros: fill the gaps with arcs of circles. D2<SBasis> V = RescaleForNonVanishingEnds(V_in); + if (V[0].isZero(tol) && V[1].isZero(tol)) return Piecewise<D2<SBasis> >(D2<SBasis>(Linear(1),SBasis())); - SBasis x = V[0], y = V[1]; SBasis r_eqn1, r_eqn2; @@ -242,6 +242,7 @@ Geom::unitVector(D2<SBasis> const &V_in, double tol, unsigned order){ r_eqn1 = -(a*x+b*y); r_eqn2 = Linear(1.)-(a*a+b*b); + for (unsigned k=1; k<=order; k++){ double r0 = (k<r_eqn1.size())? r_eqn1.at(k).at0() : 0; double r1 = (k<r_eqn1.size())? r_eqn1.at(k).at1() : 0; @@ -614,14 +615,14 @@ solve_lambda0(double a0,double a1,double c0,double c1, * or * value, speed, and cross(acceleration,speed) * of the original curve at the both ends. -* (the second is often technically usefull, as it avoids unnecessary division by |v|^2) +* (the second is often technically useful, as it avoids unnecessary division by |v|^2) * Recall that K=1/R=cross(acceleration,speed)/|speed|^3. * * Moreover, a 7-th argument 'insist_on_speed_signs' can be supplied to select solutions: * If insist_on_speed_signs == 1, only consider solutions where speeds at both ends are positively * proportional to the given ones. * If insist_on_speed_signs == 0, allow speeds to point in the opposite direction (both at the same time) -* If insist_on_speed_signs == -1, allow speeds to point in both direction independantly. +* If insist_on_speed_signs == -1, allow speeds to point in both direction independently. * * \relates D2 */ |
