Learn R Programming

spinifex (version 0.2.5)

rotate_manip_space: Performs a rotation on the manipulation space of the given manip var.

Description

A specific R3 rotation of the manipulation space for a 2D tour. Typically called by manual_tour(). The first 2 columns are x and y in the projection plane. The 3rd column extends "in the z-direction" orthogonal to the projection plane.

Usage

rotate_manip_space(manip_space, theta, phi)

Arguments

manip_space

A (p, d+1) dim matrix (manipulation space) to be rotated.

theta

Angle (radians) of "in-projection-plane" rotation (ie. on xy- of the projection). Typically set by the manip_type argument in proj_data().

phi

Angle (radians) of "out-of-projection-plane" rotation (ie. into the z-direction of the manipulation space. Effectively changes the norm of the manip_var in the projection plane.

Value

A (p, d+1) orthonormal matrix of the rotated (manipulation) space. The first 2 columns are x and y in the projection plane. The 3rd column extends "in the z-direction" orthogonal to the projection plane.

Examples

Run this code
# NOT RUN {
flea_std <- tourr::rescale(tourr::flea[,1:6])
rb  <- tourr::basis_random(n = ncol(flea_std))
msp <- create_manip_space(basis = rb, manip_var = 4)

rotate_manip_space(msp, theta = runif(1, max = 2 * pi), 
                   phi = runif(1, max = 2 * pi) )
# }

Run the code above in your browser using DataLab