function
LieGroups.SO3.Euler.to_Matrix
Euler angles to DCM for any valid axis sequence
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | angles | Real | [3] | |
| input | sequence | LieGroups.SO3.Euler.Axis | [3] | |
| input | bodyFixed | Boolean | = true | True for intrinsic/body-fixed; false for extrinsic/space-fixed |
| output | R | Real | [3, 3] |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function to_Matrix "Euler angles to DCM for any valid axis sequence"
input Real angles[3];
input LieGroups.SO3.Euler.Axis sequence[3];
input Boolean bodyFixed = true
"True for intrinsic/body-fixed; false for extrinsic/space-fixed";
output Real R[3, 3];
protected
Real elemental[3, 3];
algorithm
assert(LieGroups.SO3.Euler.validSequence(sequence),
"Euler sequence cannot repeat adjacent axes");
R := identity(3);
for i in 1:3 loop
elemental := LieGroups.SO3.Euler.rotationMatrix(sequence[i], angles[i]);
R := if bodyFixed then R * elemental else elemental * R;
end for;
end to_Matrix;