Ramer–Douglas–Peucker algorithm: Difference between revisions

Content deleted Content added
Given a 0 indexed array, `PointList[end]` is out-of-bound and invalid. I think the correct index is `PointList[end - 1]`
Tag: Reverted
Undid revision 1020742059 by 124.123.170.134 (talk)
Tags: Undo Reverted
Line 28:
end = length(PointList)
'''for''' i = 2 to (end - 1) {
d = perpendicularDistance(PointList[i], Line(PointList[1], PointList[end - 1]))
'''if''' (d > dmax) {
index = i