orthogonal | R Documentation |
Convert a quaternion to and from an equivalent orthogonal matrix
matrix2quaternion(M)
as.orthogonal(Q)
M |
A three-by-three orthogonal matrix |
Q |
A vector of quaternions |
Function matrix2quaternion()
returns a quaternion.
Function as.orthogonal()
returns either a 3\times 3
matrix or a 3\times3\times n
array of orthogonal matrices
Function matrix2quaternion()
is low-level; use
as.quaternion()
to convert arrays.
Robin K. S. Hankin
rotate
as.orthogonal(rquat(1))
o <- function(w){diag(3)-2*outer(w,w)/sum(w^2)} # Householder
matrix2quaternion(o(1:3)) # Booorrrriiinnnggg
matrix2quaternion(o(1:3) %*% o(3:1))
Q <- rquat(7)
Q <- Q/abs(Q)
as.quaternion(as.orthogonal(Q)) # +/- Q
A <- replicate(7,o(rnorm(3)) %*% o(rnorm(3)))
max(abs(as.orthogonal(as.quaternion(A))-A))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.