rotV: Rotate a 3-vector by a quaternion

View source: R/RcppExports.R

rotVR Documentation

Rotate a 3-vector by a quaternion

Description

rotV() rotates a 3-vector by a quaternion expressed as a unit 4-vector in (w,x,y,z) convention

Usage

rotV(quat, vin)

Arguments

quat

A numeric unit 4-vector (w,x,y,z) for a rotation quaternion

vin

A numeric 3-vector to be rotated by quat

Value

A numeric 3-vector after the rotation

Examples

q <- c(cos(pi/4), sin(pi/4), 0, 0)
vin <- c(0, 1, 0)
rotV(q, vin)


imuf documentation built on April 3, 2025, 8:10 p.m.