diff options
| author | JF Barraud <jf.barraud@gmail.com> | 2009-03-09 01:47:39 +0000 |
|---|---|---|
| committer | jfbarraud <jfbarraud@users.sourceforge.net> | 2009-03-09 01:47:39 +0000 |
| commit | fffb14c92df4ff0efb9271708984c75ca12b30d6 (patch) | |
| tree | 04a75637990939efdd4da28826357ff214bafc22 /src/2geom/sbasis-geometric.cpp | |
| parent | part of bug #339660; can not use Add/Rename dialog to create layer with no pr... (diff) | |
| download | inkscape-fffb14c92df4ff0efb9271708984c75ca12b30d6.tar.gz inkscape-fffb14c92df4ff0efb9271708984c75ca12b30d6.zip | |
2geom update
(bzr r7453)
Diffstat (limited to 'src/2geom/sbasis-geometric.cpp')
| -rw-r--r-- | src/2geom/sbasis-geometric.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/2geom/sbasis-geometric.cpp b/src/2geom/sbasis-geometric.cpp index 28e9fc964..c37118402 100644 --- a/src/2geom/sbasis-geometric.cpp +++ b/src/2geom/sbasis-geometric.cpp @@ -740,6 +740,18 @@ Geom::cubics_with_prescribed_curvature(Point const &M0, Point const &M1, return cubics_fitting_curvature(M0,M1,dM0,dM1,d2M0xdM0,d2M1xdM1,insist_on_speed_signs,epsilon); } + +/** +* \brief returns all the parameter values of A whose tangent passes through P. +*/ +std::vector<double> find_tangents(Point P, D2<SBasis> const &A) { + SBasis crs (cross(A - P, derivative(A))); + crs = shift(crs*Linear(-1, 0)*Linear(-1, 0), -2); // We know that there is a double root at t=0 so we divide out t^2 +// JFB points out that this is equivalent to (t-1)^2 followed by a divide by s^2 (shift) + return roots(crs); +} + + //}; // namespace |
