Skip to content

polynomialCurves2d

dlegland edited this page Mar 3, 2016 · 2 revisions

The polynomialCurves2d module of the MatGeom library provides functions for the manipulation of planar smooth curves that can be parameterized by polynomials for each x and y coordinate.

A polynomial curve is represented by 3 row vectors:

  • the bounds of the parametrization
  • the coefficients for the x coordinate (in increasing degree)
  • the coefficients for the y coordinate (in increasing degree)

Example:

C = {[0 1], [3 4], [0 1 -1]};

represents the curve defined by:

x(t) = 3 + 4*t;
y(t) = t - t*t;

for t belonging to the interval [0 1].

As each coordinate is represented by a polynomial, it is easy to compute various parameters like curvature, normal, or the exact geodesic length of the curve.

For most functions, parameters are given as three separate arguments. Sometimes, only the 2 parameters corresponding to the X and Y coefficients are required.

Global features

polynomialCurveCentroid   - Compute the centroid of a polynomial curve
polynomialCurveProjection - Projection of a point on a polynomial curve
polynomialCurveLength     - Compute the length of a polynomial curve
polynomialCurvePoint      - Compute point corresponding to a position
polynomialCurvePosition   - Compute position on a curve for a given length

Local features

polynomialCurveDerivative - Compute derivative vector of a polynomial curve
polynomialCurveNormal     - Compute the normal of a polynomial curve
polynomialCurveCurvature  - Compute the local curvature of a polynomial curve
polynomialCurveCurvatures - Compute curvatures of a polynomial revolution surface

Fitting

polynomialCurveFit        - Fit a polynomial curve to a series of points
polynomialCurveSetFit     - Fit a set of polynomial curves to a segmented image

Drawing

drawPolynomialCurve       - Draw a polynomial curve approximation

Utilities

polynomialDerivate        - Derivate a polynomial
polyfit2                  - Polynomial approximation of a curve
Clone this wiki locally