← Back

Visvalingam–Whyatt (VW)

A polyline simplification algorithm that removes the point forming the triangle of smallest area with its two neighbours — iterating until all remaining triangles exceed a threshold.

How it works

For every interior point, compute the area of the triangle it forms with its immediate neighbours. Repeatedly remove the point whose triangle has the smallest area, then recompute the areas of the two newly-adjacent points. Stop when the smallest area exceeds the threshold.

This differs from RDP in two key ways: it is iterative not recursive, and it uses triangle area rather than perpendicular distance from a chord. Area is sensitive to both distance and angle, so VW tends to produce more perceptually uniform simplifications — it better preserves corners and avoids the "sawtooth" artefacts that RDP can introduce near recursive split points.

function VW(points, threshold): // Compute triangle area for every interior point for i in 1 … n-2: area[i] = triangleArea(points[i-1], points[i], points[i+1]) while min(area) < threshold: i = argmin(area) // find the least-significant point remove points[i] // update the two neighbours with the new triangle area[prev(i)] = triangleArea(prev(prev(i)), prev(i), next(i)) area[next(i)] = triangleArea(prev(i), next(i), next(next(i)))
Effective area. After removing a point with area A, a neighbour's recomputed area might be smaller than A — which would violate the ordering. The fix: clamp each updated area to max(computed, A). This guarantees that the sequence of removal areas is non-decreasing, so the algorithm doubles as an importance ranking: any N-point simplification is produced by keeping the N points with the largest effective area.

Triangle area

The area of the triangle formed by three consecutive points is the fundamental metric. Drag Pn to see how position affects the area — and therefore the point's chance of being removed.

Drag the amber point. Points close to the line between their neighbours have small area and are removed first.

Live demo

Each point is coloured by its effective area rank —
red = removed first (least significant)
blue = removed last (most significant)
white = simplified path

6018 points

Step-by-step

Each step removes the point with the current minimum triangle area. The amber triangle is the one about to be eliminated. Removed points fade out.

Step 0 / 0
Press Next to begin.

VW vs RDP

Both algorithms simplify the same path to the same number of points — but they make different choices about which ones to keep. VW preserves perceptually significant shape changes; RDP preserves points that deviate furthest from a local chord.

Visvalingam–Whyatt
Ramer–Douglas–Peucker
14 points