| rot_ab | R Documentation |
Rotate a sample of spherical data by a rotation matrix
{\bf H}_{{\bf a},{\bf b}} = ({\bf a}+{\bf b})({\bf a}+{\bf b})' /
(1 + {\bf a}'{\bf b}) - {\bf I}_p.
rot_ab(X, a, b)
H_ab(a, b)
X |
a sample of spherical data, an array of size |
a |
vector on |
b |
vector on |
The vectors a and b are checked for unit norms.
rot_ab: an array or matrix with the same size as X
containing the rotated sample.
H_ab: a rotation matrix of size c(p, p).
p <- 3
a <- c(rep(0, p - 1), 1)
b <- c(1, rep(0, p - 1))
H_ab(a = a, b = b)
X <- r_alt(n = 100, p = p, M = 1, alt = "vMF", kappa = 10)[, , 1]
X_rot <- rot_ab(X, a = a, b = b)
s3d <- scatterplot3d::scatterplot3d(X, pch = 16, xlim = c(-1.1, 1.1),
ylim = c(-1.1, 1.1), zlim = c(-1.1, 1.1))
s3d$points3d(X_rot, col = 2, pch = 16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.