Learn R Programming

Momocs (version 0.2-6)

coo.sample.rr: Samples points with "equally spaced" angles.

Description

coo.sample.rr samples n points in coo so that the radii departing from the coo's centroid are equals. This function uses polar coordinates and complex algebra.

Usage

coo.sample.rr(coo, n)

Arguments

coo
A list or a matrix of coordinates.
n
integer. The number of points to sample.

Value

  • Returns a list with components:
    • $pixindicesvector of radii indices;
    • $radiivector of sampled radii lengths;
    • $phasevector of phases;
    • $coordcoordinates of sampled points for a centered shape;
    • $orig.coordcoordinates of sampled points on the original shape;

See Also

coo.sample.

Examples

Run this code
data(bot)
coo <- bot@coo[[1]]
coo.plot(coo,  main="24 points with equally spaced radii")
rad <- coo.sample.rr(coo, 24)$orig.coord
cent <- coo.centpos(coo)
segments(cent[1], cent[2], rad[, 1], rad[, 2], col=col.summer(24))
points(coo.sample.rr(coo, 24)$orig.coord, pch=20)

Run the code above in your browser using DataLab