CS133
Computational Geometry
Simplification Algorithms
1
CS133 Computational Geometry Simplification Algorithms 1 Line - - PowerPoint PPT Presentation
CS133 Computational Geometry Simplification Algorithms 1 Line Simplification ? 2 Line Simplification Given a line string and a distance threshold , return a simplified line string such that any point in the input line string is not
1
2
3
4
β€ π
5
β€ π
6
7
β€ π
8
β€ π
9
β€ π
10
β€ π
11
12
13
function DouglasPeucker(P[], π) // Find the point with the maximum distance (=maximum cross product) cmax = 0 index = 0 for i = 2 to ( end - 1) c = π 1 π[π] Γ π 1 π[π] if ( c > cmax ) index = i cmax = c if (cmax / π 1 [π π > π) { R1 = DouglasPeucker(P[1..index], π) R2 = DouglasPeucker(P[index..n], π) R1.removeLast return R1 || R2 // Concatenate the two lists else return [P[1], P[n]] // Only return the first and last points
14
π π = π π1 + π π β π1 + π π
15
16
17
π·π =
1 π+1
2π π =
2π! π+1 !π!
18
By Eric DΓ©trez (as published at www.texample.net in 2008-10-09) - The image is the result of a latex script example published at [1]. All the site is under CC-2.5-by license, as seen on every page of the wite., CC BY 2.5, https://commons.wikimedia.org/w/index.php?curid=56872963
19
1 = π1 β 2, in π2 = π2 β 2
20
π1 π2
21
22
23