title: Visvalingam-Whyatt polyline simplification algorithm clarification
body: <p>I'm trying to implement a polyline simplification algorithm. The original article can be found here: <a href="http://archive.is/Tzq2" rel="noreferrer">http://archive.is/Tzq2</a>. It seems straightforward in concept but I don't understand the sample algorithm (I think it's poorly worded) pseudocode supplied and was hoping someone could provide some insight. From the article, I gathered that the basic idea is to</p>
  
  <ol>
  <li>Calculate the effective area (formed by the triangle between three consecutive points on a line) for each point and delete those with 0 area</li>
  <li>Starting with the smallest area, compare the point's area with a threshold, and if the area is below that threshold, delete it from the polyline.</li>
  <li>Move to the two adjacent points and recalculate their areas as they've changed</li>
  <li>Go back to 2 until all point areas  under the threshold have been removed</li>
  </ol>
  
  <p>The algorithm is as follows (copied verbatim from the article):</p>
  
  <ul>
  <li>Compute the effective area of each point
  Delete all points with zero area and store them in a separate list with this area</li>
  <li>REPEAT
  <ul>
  <li>Find the point with the least effective area and call it the current point. If its calculated area is less than that of the last point to be eliminated, use the latter's area instead. (This ensures that the current point cannot be eliminated without eliminating previously eliminated points.)</li>
  <li>Delete the current point from the original list and add this to the new list together with its associated area so that the line may be filtered at run time.</li>
  <li>Recompute the effective area of the two adjoining points (see Figure 1b).</li>
  </ul></li>
  <li>UNTIL
  <ul>
  <li>The original line consists of only 2 points, namely the start and end points.</li>
  </ul></li>
  </ul>
  
  <p>I'm confused with the 'if' clause in the first step under 'REPEAT'... could anyone clarify?</p>