Learn R Programming

rotations (version 0.1)

genR: Generate rotations

Description

Generate rotations according to Rodrigues' formula.

Usage

genR(r, S = NULL, space = "SO3")

Arguments

r
vector of angles.
S
central orientation.
space
indicates the desired representation: rotation matrix "SO3" or quaternions "Q4."

Value

  • A matrix where each row is a sample point in the desired space.

Details

Given a vector $u\in R^3$ of length one and angle of rotation $r$, a rotation can be formed using Rodrigues' formula $$\cos(r)I_{3\times 3}+\sin(r)\Phi(u)+(1-\cos(r))uu^\top$$ where $I_{3\times 3}$ is the $3\times 3$ identity matrix, $\Phi(u)$ is a $3\times 3$ skew-symmetric matirix with upper triangular elements $-u_3$, $u_2$ and $-u_1$ in that order.

Examples

Run this code
r<-rvmises(20,0.01)
Rs<-genR(r,space="SO3")
Qs<-genR(r,space="Q4")

Run the code above in your browser using DataLab