Skip to contents

Get the rotation angle and axis for a given quaternion.

Usage

quaternion_to_axis_angle(q)

Arguments

q

A numeric vector of length 4 (quaternion).

Value

A list with elements axis (numeric vector of length 3) and angle (number).

Examples

result <- quaternion_to_axis_angle(c(0, 0, 0, 1))
result$axis
#> x y z 
#> 1 0 0 
result$angle
#> [1] 0