Learn R Programming

Momocs (version 1.1.6)

tfourier: Tangent angle Fourier transform

Description

tfourier computes tangent angle Fourier analysis from a matrix or a list of coordinates.

Usage

tfourier(x, ...)

# S3 method for default tfourier(x, nb.h, smooth.it = 0, norm = FALSE, verbose = TRUE, ...)

# S3 method for Out tfourier(x, nb.h = 40, smooth.it = 0, norm = TRUE, verbose = TRUE, ...)

Arguments

x
A list or matrix of coordinates or an Out
...
useless here
nb.h
integer. The number of harmonics to use. If missing, 12 is used on shapes; 99 percent of harmonic power on Out objects, both with messages.
smooth.it
integer. The number of smoothing iterations to perform
norm
logical. Whether to scale and register new coordinates so that the first point used is sent on the origin.
verbose
logical. Whether to display diagnosis messages.

Value

A list with the following components:
  • ao ao harmonic coefficient
  • an vector of \(a_{1->n}\) harmonic coefficients
  • bn vector of \(b_{1->n}\) harmonic coefficients
  • phi vector of variation of the tangent angle
  • t vector of distance along the perimeter expressed in radians
  • perimeter numeric. The perimeter of the outline
  • thetao numeric. The first tangent angle
  • x1 The x-coordinate of the first point
  • y1 The y-coordinate of the first point.

References

Zahn CT, Roskies RZ. 1972. Fourier Descriptors for Plane Closed Curves. IEEE Transactions on Computers C-21: 269-281. Claude, J. (2008) Morphometrics with R, Use R! series, Springer 316 pp.

See Also

Other tfourier: tfourier_i, tfourier_shape

Examples

Run this code
data(bot)
coo <- bot[1]
coo_plot(coo)
tf  <- tfourier(coo, 12)
tf
tfi <- tfourier_i(tf)
coo_draw(tfi, border='red', col=NA) # the outline is not closed...
coo_draw(tfourier_i(tf, force2close=TRUE), border='blue', col=NA) # we force it to close.

Run the code above in your browser using DataLab