Learn R Programming

Momocs (version 0.2-03)

rfourier: Calculates radii variation Fourier analysis.

Description

rfourier computes radii variation Fourier analysis from a matrix or a list of coordinates.

Usage

rfourier(coo, nb.h, smooth.it = 0, norm = FALSE, silent=FALSE)

Arguments

coo
A list or matrix of coordinates.
nb.h
integer. The number of harmonics to calculate/use.
smooth.it
integer. The number of smoothing iterations to perform.
norm
logical. Whether to scale the outlines so that the mean length of the radii used equals 1.
silent
logical. Whether to display diagnosis messages.

Value

  • A list with these components:
  • anvector of $a_{1->n}$ harmonic coefficients.
  • bnvector of $b_{1->n}$ harmonic coefficients.
  • aoao Harmonic coefficient.
  • rvector of radii lengths.

Details

Given a closed outline, the radius $r$, taken as the distance from the outline barycentre and a given point of the outline, can be expressed as a periodic function of the angle $\theta$. Harmonics from $0$ to $k$ approximate the function $r(\theta)$: $$r(\theta)= \frac{1}{2}a_0 + \sum\limits_{n=1}^{k}a_k\cos(w_k\theta + b_k\sin(w_k\theta)$$ with: $$a_n = \frac{2}{p}\sum\limits_{n=1}^{p}r_i\cos(n\theta_i)$$ $$b_n = \frac{2}{p}\sum\limits_{n=1}^{p}r_i\sin(n\theta_i)$$ with $$a_0 = \sqrt{\frac{2}{p}}\sum\limits_{n=1}^{p}r_i$$ The $a_n$ and $b_n$ harmonic coefficients, extracted for every individual shape, are then used for multivariate analyses.

References

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

See Also

rfourier.i for the inverse operation, rfourier.shape. efourier, tfourier for the other members of the Fourier's family.

Examples

Run this code
data(bot)
coo <- coo.center(bot@coo[[1]]) # centering is almost mandatory for rfourier family
coo.plot(coo)
rf  <- rfourier(coo, 12)
rf
rfi <- rfourier.i(rf)
l2m(rfi)
coo.draw(rfi, border="red", col=NA)

Run the code above in your browser using DataLab