ConvertAttitude.m
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
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.3.0.0 | Typo in description |
||
1.2.0.0 | - DCM to MRP conversion modified to avoid singularity issues
|
||
1.1.0.0 | Additional description. |
||
1.0.0.0 |