function
MathUtilities.wrapAngle
Wrap an angle to the principal interval
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | angle | Real | (unit = "rad") | |
| output | result | Real | (unit = "rad") |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function wrapAngle "Wrap an angle to the principal interval"
input Real angle(unit = "rad");
output Real result(unit = "rad");
algorithm
result := atan2(sin(angle), cos(angle));
annotation(Inline = true);
end wrapAngle;