Description Usage Arguments Value Examples
Both vector x and y has to be normalized.
1 |
x |
vector to be rotated (has to be normalized). |
y |
reference vector (has to be normalized). |
n x n rotation matrix.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.