Rotate a vector by a quaternion

Description

vectQrot performs a vector rotation by a quaternion.

Usage

1
vectQrot(Q, rr)

Arguments

Q

Quaternion (Q) vector [q1, q2, q3, q4].

rr

Vector [x, y, z].

Value

Rotated vector [x, y, z].

Author(s)

Jose Gama

Examples

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.