.IdealizedContact.Components.VectorCalculations.vectorNormalization

Information

The function returns the unit vector v/length(v) of vector v. If length(v) is close to zero (more precisely, if length(v) < eps), a zero vector is returned to avoid division by zero. The constant eps is set to 100*Modelica.Constants.eps. The function is based on Modelica.Math.Vectors.normalize.

See also

Modelica.Math.Vectors.length

Interface

function vectorNormalization
  input Real v[:] "Vector";
  constant Real eps = 100*Modelica.Constants.eps "if |v| < eps then result = v/eps";
  output Real result[size(v, 1)] "Input vector v normalized to length=1";
end vectorNormalization;

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos