Learn R Programming

Momocs (version 0.2-6)

coo.trans: Transles a list or a matrix of coordinates.

Description

coo.trans translates coo by x and {y} on the two dimensions, respectively.

Usage

coo.trans(coo, x, y)

Arguments

coo
A list or a matrix of coordinates.
x
numeric. The x-axis translation.
y
numeric. The y-axis translation.

Value

  • Returns a matrix of (x; y)coordinates.

Examples

Run this code
data(bot)
coo <- coo.scale(coo.center(bot@coo[[1]]))

tx <- seq(0, 10*pi, length=50)
ty <- sin(tx)*5
cols <- col.summer(50)

coo.plot(xlim=c(0, 10*pi), main="The bottle's wave")
lines(tx, ty, col="grey60", lty=2)
for (i in seq(along=tx)) {
  coo.draw(coo.trans(coo, tx[i], ty[i]), col=NA, border=cols[i])
}

Run the code above in your browser using DataLab