Learn R Programming

Morpho (version 2.12)

resampleCurve: Resample a curve equidistantly

Description

Resample a curve equidistantly (optionally with smoothing)

Usage

resampleCurve(x, n, smooth = FALSE, smoothn = n, open = TRUE)

Value

returns a matrix containing the resampled curve

Arguments

x

matrix containing coordinates

n

number of resulting points on the resampled curve

smooth

logical: if TRUE, the resulting curve will be smoothed by using bezier curves.

smoothn

integer: define the refinement of the bezier curve. The higher this value, the closer the final curve will be to the original.

open

logical: define whether it is a closed curve or not.

Examples

Run this code
data(nose)
x <- shortnose.lm[c(304:323),]
xsample <- resampleCurve(x,n=50)

Run the code above in your browser using DataLab