ConvertAttitude.m

Version 1.3.0.0 (12.3 KB) by Josh
Easily convert between common attitude parameter sets
810 Downloads
Updated 1 Aug 2014

View License

This function will convert between the following attitude parameter sets:
- Direction Cosine Matrix (DCM)
- Euler Angles (all 12 sets are supported)
- Quaternions (Euler parameters)
- Principal Rotation Vector (PRV)
- Classical Rodrigues Parameters (CRP, Gibbs vector)
- Modified Rodrigues Parameters (MRP)
Additionally, this function can easily convert a batch of attitudes from one parameterization to another.

SINGLE ATTITUDE EXAMPLE:

Convert an MRP to 3-2-1 Euler Angle sequence.

newAttitude = ConvertAttitude([.1; .2; .3], 'mrp', '321')

newAttitude =
1.3564
0.3519
0.7416

BATCH ATTITUDE EXAMPLE:

newAttitude = ConvertAttitude([[.1; .2; .3],[.3; .2; .1]], 'mrp', '321')

newAttitude =
1.3564, 0.7416
0.3519, 0.3519
0.7416, 1.3564

Note than any angles must be in radians. Let me know if you'd like this function to support additional parameter sets.

Cite As

Josh (2024). ConvertAttitude.m (https://www.mathworks.com/matlabcentral/fileexchange/47318-convertattitude-m), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Phased Array Design and Analysis in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.3.0.0

Typo in description

1.2.0.0

- DCM to MRP conversion modified to avoid singularity issues
- Principal Rotation Vector now a 3-vector with magnitude equal to principal rotation angle
- Batch attitude conversion example added to function description

1.1.0.0

Additional description.

1.0.0.0