poly_simplifyΒΆ
poly_simplify uses the Douglas-Peucker algorithm to simplify a 2D line.
- rmXYOut = poly_simplify(nSteps, rsTol, x, y)
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
- nSteps
Number of iterations or -1 if the parameter rsTol should be used.
- rsTol
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.
- x
is a vector with x coordinates.
- y
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