CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

LieGroups.SO3.Euler.axisIndex

Convert an axis enumeration to a matrix index

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
inputaxisLieGroups.SO3.Euler.Axis
outputindexInteger

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

function axisIndex "Convert an axis enumeration to a matrix index"
  input LieGroups.SO3.Euler.Axis axis;
  output Integer index;
algorithm
  index := if axis == LieGroups.SO3.Euler.Axis.x then 1
    elseif axis == LieGroups.SO3.Euler.Axis.y then 2 else 3;
end axisIndex;