CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

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.

RoleNameTypeDimensions / attributes / defaultDescription
inputangleReal(unit = "rad")
outputresultReal(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;