Learn R Programming

RSpincalc (version 1.0.2)

vectQrot: Rotate a vector by a quaternion

Description

vectQrot performs a vector rotation by a quaternion.

Usage

vectQrot(Q, rr)

Arguments

Q
Quaternion (Q) vector [q1, q2, q3, q4].
rr
Vector [x, y, z].

Value

Rotated vector [x, y, z].

Examples

Run this code
Q <- c(-0.1677489, -0.7369231, -0.3682588, 0.5414703)
v <- c(1, 2, 3)
vectQrot(Q, v)

Run the code above in your browser using DataLab