Learn R Programming

Momocs (version 0.2-6)

coo.center: Centers a list or matrix of coordinates.

Description

coo.center centers the coo's centroid on the origin.

Usage

coo.center(coo)

Arguments

coo
A list or a matrix of coordinates.

Value

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

Examples

Run this code
def.par <- par(no.readonly = TRUE)
layout(matrix(1:2, 1, 2))
data(bot)
coo <- bot@coo[[1]]
coo.plot(coo, main="A shape")
abline(v=0, h=0, col="grey60", lty=2)
coo.plot(coo.center(coo), border="red", col=NA, main="A centered shape")
abline(v=0, h=0, col="grey60", lty=2)
par(def.par)

Run the code above in your browser using DataLab