Ramer-Douglas-Peucker line simplification: Difference between revisions

m
added whitespace and highlighting to the task's preamble, elided a stray comma.
m (→‎{{header|REXX}}: corrected spelling of the name: Peucker.)
m (added whitespace and highlighting to the task's preamble, elided a stray comma.)
Line 1:
[[Category:Geometry]]
[[Category:Recursion]]
 
{{task}}Ramer–Douglas–Peucker algorithm is a line simplification algorithm for reducing the number of points used to define its shape.<ref>[https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm]</ref>
{{task}}
{{task}}The &nbsp; '''Ramer–Douglas–Peucker''' &nbsp; algorithm is a line simplification algorithm for reducing the number of points used to define its shape. <ref>[https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm]</ref>
 
 
;Task:
Using the &nbsp; '''Ramer–Douglas–Peucker''' &nbsp; algorithm, simplify the 2D line defined by the points:
(0,0) (1,0.1) (2,-0.1) (3,5) (4,6) (5,7) (6,8.1) (7,9) (8,9) (9,9)
 
The error threshold to use is: &nbsp; '''1.0'''.
 
Display the remaining points.
Simplify the 2D line defined by the points (0,0),(1,0.1)(2,-0.1)(3,5)(4,6)(5,7)(6,8.1)(7,9)(8,9)(9,9) using the Ramer–Douglas–Peucker algorithm. The error threshold to use is 1.0. Display the remaining points.
<br><br>
 
=={{header|C++}}==