Learn R Programming

AnalyzeFMRI (version 1.1-24)

R2Q: Rotation to quaternion

Description

Convert from (proper) rotation matrix to quaternion form.

Usage

R2Q(R,qfac=NULL)

Arguments

R

Rotation matrix

qfac

qfac nifti field. It is pixdim[1]. If NULL, R is transformed to have determinant 1

Value

The quaternion.

See Also

Q2R

Examples

Run this code
# NOT RUN {
L <- f.read.nifti.header(system.file("example-nifti.hdr", package="AnalyzeFMRI"))
Q <- c(L$quatern.b,L$quatern.c,L$quatern.d)
R <- Q2R(Q,L$pixdim[1])
Q
R2Q(R)
# }

Run the code above in your browser using DataLab