functionvectorNormalization

Return normalized vector such that length = 1 and prevent zero-division for zero vector

Information

<!DOCTYPE html><html>
<p>The function returns the <b>unit vector</b> <code>v/length(v)</code> of vector v. If length(v) is close to zero (more precisely, if length(v) &LT; 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 <a href="Modelica.Math.Vectors.normalize.html">Modelica.Math.Vectors.normalize</a>.</p>
<p><h4>See also</h4></p>
<p><a href="Modelica.Math.Vectors.length.html">Modelica.Math.Vectors.length</a> </p>
</html>

Inputs

TypeNameDefaultDescription
Real[:]vVector

Outputs

TypeNameDefaultDescription
Real[size(v, 1)]resultInput vector v normalized to length=1