CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

LieGroups.SO2.to_Matrix

Convert angle to 2x2 rotation matrix

Public declarations

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

RoleNameTypeDimensions / attributes / defaultDescription
inputthetaRealRotation angle [rad]
outputRReal[2,2]2x2 rotation matrix

Modelica declarations and implementation

Show parameters, interfaces and source

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

function to_Matrix "Convert angle to 2x2 rotation matrix"
  input Real theta "Rotation angle [rad]";
  output Real R[2,2] "2x2 rotation matrix";
protected
  Real c, s;
algorithm
  c := cos(theta);
  s := sin(theta);
  R := {{c, -s}, {s, c}};
end to_Matrix;