poly_simplify uses the Douglas-Peucker algorithm to simplify a 2D line.
Return Value
rmXYOut is a matrix with two columns. The first column contains the x and the second column the y coordinates. In case of an error the function returns a scalar value -1.
Parameters
Number of iterations or -1 if the parameter rsTol should be used.
sets the tolerance. If rsTol is 0 and nSteps is -1, the calculated curve is identical to the original curve but all unnecessary points are removed.
is a vector with x coordinates.
is a vector with y coordinates.
Example
* poly_simplify(-1, 0, [1,2,3], [1,2,3])
1.0000 1.0000
3.0000 3.0000
See also
id-437592