Learn R Programming

Momocs (version 1.2.9)

tfourier_shape: Calculates and draws 'tfourier' shapes.

Description

tfourier_shape calculates a 'Fourier tangent angle shape' given Fourier coefficients (see Details) or can generate some 'tfourier' shapes.

Usage

tfourier_shape(an, bn, ao = 0, nb.h, nb.pts = 80, alpha = 2,
  plot = TRUE)

Arguments

an

numeric. The \(a_n\) Fourier coefficients on which to calculate a shape.

bn

numeric. The \(b_n\) Fourier coefficients on which to calculate a shape.

ao

ao Harmonic coefficient.

nb.h

integer. The number of harmonics to use.

nb.pts

integer. The number of points to calculate.

alpha

numeric. The power coefficient associated with the (usually decreasing) amplitude of the Fourier coefficients (see Details).

plot

logical. Whether to plot or not the shape.

Value

A matrix of (x; y) coordinates.

References

Claude, J. (2008) Morphometrics with R, Use R! series, Springer 316 pp.

See Also

Other tfourier: tfourier_i, tfourier

Examples

Run this code
# NOT RUN {
tf <- tfourier(bot[1], 24)
tfourier_shape(tf$an, tf$bn) # equivalent to rfourier_i(rf)
tfourier_shape()
tfourier_shape(nb.h=6, alpha=0.4, nb.pts=500)
panel(Out(a2l(replicate(100,
coo_force2close(tfourier_shape(nb.h=6, alpha=2, nb.pts=200, plot=FALSE)))))) # biological shapes
# }

Run the code above in your browser using DataLab