|
Posted by Paul Cooper on December 8, 2005, 4:57 pm
Please log in for more thread options On Thu, 8 Dec 2005 13:07:58 -0500, "Jacquelin Hardy"
>Hello group,
>
> I have been trying hard to find a version of the
>Douglas-Peucker algorithm in Visual Basic 6, without result so far. As I do
>not know C or C++, I cannot make out what Google can find for the subject. A
>good explanation of the algorithm in plain language would suite me right.
>
>Thank you all
>
>Jacquelin Hardy
>from cold Canada
>
As follows:
Mark all vertices for discard.
Find the furthest vertex from the line joing the endpoints.
If ( further away than the threshold distance) Then {
Mark the vertex for retention
Repeat for each subsection.
} else stop
This is a classic recursive algorithm - you can actually implement it
in very few lines of code. If you haven't done it before, the only
slightly tricky bit is the formula for the distance of a point from a
line - and that's a one-liner.
Paul
|