rotation.matrix.between.vectors: This function returns n by n rotation matrix that align...

Description Usage Arguments Value Examples

Description

Both vector x and y has to be normalized.

Usage

1

Arguments

x

vector to be rotated (has to be normalized).

y

reference vector (has to be normalized).

Value

n x n rotation matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
x <- vector.to.unit(c(1,0,0))
y <- vector.to.unit(c(0,1,0))
Rx2y <- rotation.matrix.between.vectors(x, y)
x %*% Rx2y
y
x <- vector.to.unit(c(5,0,2,4,6))
y <- vector.to.unit(c(0,1,0,8,-5))
Rx2y <- rotation.matrix.between.vectors(x, y)
x %*% Rx2y
y
x <- vector.to.unit(c(8,0,0))
y <- vector.to.unit(c(2,0,0))
Rx2y <- rotation.matrix.between.vectors(x, y)
x %*% Rx2y
y

browarsoftware/RMoCap documentation built on May 16, 2019, 7:28 a.m.