.. highlightlang:: us .. _poly_simplify: poly_simplify ============= .. index:: poly_simplify .. us.tag poly_simplify ENGLISH base_graph New363 :ref:`poly_simplify` uses the Douglas-Peucker algorithm to simplify a 2D line. .. function:: rmXYOut = poly_simplify(nSteps, rsTol, x, y) .. us.return **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. .. us.params **Parameters** .. uparam:: nSteps Number of iterations or -1 if the parameter *rsTol* should be used. .. uparam:: 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. .. uparam:: x is a vector with x coordinates. .. uparam:: y is a vector with y coordinates. .. us.example **Example** :: * poly_simplify(-1, 0, [1,2,3], [1,2,3]) 1.0000 1.0000 3.0000 3.0000 .. seealso:: :ref:`overview-mathematic`, :ref:`polyarea` :sub:`id-437592`