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.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | theta | Real | | Rotation angle [rad] |
| output | R | Real | [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;