.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-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos