# Q2DCM: Convert from rotation Quaternions to Direction Cosine Matrix In RSpincalc: Conversion Between Attitude Representations of DCM, Euler Angles, Quaternions, and Euler Vectors

## Description

`Q2DCM` converts from Quaternions to Direction Cosine Matrix (DCM).

## Usage

 `1` ```Q2DCM(Q, tol = 10 * .Machine\$double.eps, ichk = FALSE, ignoreAllChk = FALSE) ```

## Arguments

 `Q` Quaternion (Q) vector [q1, q2, q3, q4]. `tol` Tolerance from deviations from unity for the determinant of rotation matrices or the the vector length for unitary vectors. `ichk` Logical, FALSE=disables near-singularity warnings. `ignoreAllChk` Logical, TRUE=disables all warnings and error checks (use with caution!).

## Value

Direction Cosine Matrix (DCM) 3x3xN.

Jose Gama

## References

by John Fuller, 14 Jul 2008 SpinCalc, Function to Convert between DCM, Euler angles, Quaternions, and Euler vectors. http://www.mathworks.com/matlabcentral/fileexchange/20696-function-to-convert-between-dcm–euler-angles–quaternions–and-euler-vectors

Paolo de Leva, 01 May 2013 SpinConv, Conversion from a rotation representation type to another. http://www.mathworks.com/matlabcentral/fileexchange/41562-spinconv

`DCM2Q`

## Examples

 ```1 2``` ```Q <- c(-0.1677489, -0.7369231, -0.3682588, 0.5414703) Q2DCM(Q) ```

### Example output

```           [,1]       [,2]       [,3]
[1,]  0.1423907  0.3610947 -0.9215940
[2,]  0.7244189 -0.6724915 -0.1515663
[3,] -0.6744939 -0.6460385 -0.3573404
```

RSpincalc documentation built on May 2, 2019, 10:59 a.m.