Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rotonmat

rotate matrix of landmarks


Description

rotate matrix of landmarks by using a rotation determined by two matrices.

Usage

rotonmat(X, refmat, tarmat, scale = TRUE, reflection = FALSE,
  weights = NULL, centerweight = FALSE, getTrafo = FALSE)

Arguments

X

Matrix to be rotated

refmat

reference matrix used to estimate rotation parameters

tarmat

target matrix used to estimate rotation parameters

scale

logical: requests scaling to minimize sums of squared distances

reflection

logical: if TRUE, reflections are allowed.

weights

vector of length k, containing weights for each landmark.

centerweight

logical: if weights are defined and centerweigths=TRUE, the matrix will be centered according to these weights instead of the barycenter.

getTrafo

logical: if TRUE, a 4x4 transformation matrix will also be returned.

Details

A matrix is rotated by rotation parameters determined by two different matrices. This is usefull, if the rotation parameters are to be estimated by a subset of landmark coordinates.

Value

if getTrafo=FALSE the transformed X will be returned, else alist containing:

Xrot

the transformed matrix X

trafo

a 4x4 transformation matrix

Author(s)

Stefan Schlager

See Also

Examples

data(nose)
shortnose.rot <-
rotonmat(shortnose.lm,shortnose.lm[1:9,],longnose.lm[1:9,])

##view result
## Not run: 
deformGrid3d(shortnose.rot,shortnose.lm,ngrid=0)

## End(Not run)

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.