diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-08-27 16:17:25 +0000 |
|---|---|---|
| committer | Krzysztof Kosinski <tweenk.pl@gmail.com> | 2011-08-27 16:17:25 +0000 |
| commit | de7de7c53f938e3322813366af5266686b92936a (patch) | |
| tree | 3253a3ae81978b3625413757b8796f7b89d54baf /src/libnr | |
| parent | Completely remove NRRect, NRRectL, in-svg-plane.h (diff) | |
| download | inkscape-de7de7c53f938e3322813366af5266686b92936a.tar.gz inkscape-de7de7c53f938e3322813366af5266686b92936a.zip | |
Remove unused function project_on_linesegment from nr-point-fns.h
(bzr r10582.1.7)
Diffstat (limited to 'src/libnr')
| -rw-r--r-- | src/libnr/nr-point-fns.cpp | 22 | ||||
| -rw-r--r-- | src/libnr/nr-point-fns.h | 2 |
2 files changed, 1 insertions, 23 deletions
diff --git a/src/libnr/nr-point-fns.cpp b/src/libnr/nr-point-fns.cpp index a2e74c112..e4fb8cf0b 100644 --- a/src/libnr/nr-point-fns.cpp +++ b/src/libnr/nr-point-fns.cpp @@ -16,6 +16,7 @@ snap_vector_midpoint (Geom::Point const &p, Geom::Point const &begin, Geom::Poin return (begin + r_snapped * be); } +// equivalent to Geom::LineSegment(begin, end).nearestPoint(p) double get_offset_between_points (Geom::Point const &p, Geom::Point const &begin, Geom::Point const &end) { @@ -29,27 +30,6 @@ get_offset_between_points (Geom::Point const &p, Geom::Point const &begin, Geom: return (r / length); } -Geom::Point -project_on_linesegment(Geom::Point const &p, Geom::Point const &p1, Geom::Point const &p2) -{ - // p_proj = projection of p on the linesegment running from p1 to p2 - // p_proj = p1 + u (p2 - p1) - // calculate u according to "Minimum Distance between a Point and a Line" - // see http://local.wasp.uwa.edu.au/~pbourke/geometry/pointline/ - - // Warning: projected points will not necessarily be in between the endpoints of the linesegments! - - if (p1 == p2) { // to avoid div. by zero below - return p; - } - - Geom::Point d1(p-p1); // delta 1 - Geom::Point d2(p2-p1); // delta 2 - double u = Geom::dot(d1, d2) / Geom::L2sq(d2); - - return (p1 + u*(p2-p1)); -} - /* Local Variables: mode:c++ diff --git a/src/libnr/nr-point-fns.h b/src/libnr/nr-point-fns.h index b26c969aa..036c943f1 100644 --- a/src/libnr/nr-point-fns.h +++ b/src/libnr/nr-point-fns.h @@ -7,8 +7,6 @@ Geom::Point snap_vector_midpoint (Geom::Point const &p, Geom::Point const &begin double get_offset_between_points (Geom::Point const &p, Geom::Point const &begin, Geom::Point const &end); -Geom::Point project_on_linesegment(Geom::Point const &p, Geom::Point const &p1, Geom::Point const &p2); - #endif /* !__NR_POINT_OPS_H__ */ /* |
