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]`
Undid revision 1020743260 by Dostiharise (talk) "Assumes the input is a one-based array"
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