Vectors.normalizeWithAssert(v);
The function call "Vectors.normalizeWithAssert(v)
" returns the
unit vector "v/sqrt(v*v)
" of vector v.
If vector v is a zero vector, an assert is triggered.
Since the function has the "Inline" annotation, it is usually inlined and symbolic processing is applied.
normalizeWithAssert({1,2,3}); // = {0.267, 0.534, 0.802} normalizeWithAssert({0,0,0}); // error (an assert is triggered)
Vectors.length, Vectors.normalize
function normalizeWithAssert import Modelica.Math.Vectors.length; extends Modelica.Icons.Function; input Real v[:] "Real vector"; output Real result[size(v, 1)] "Input vector v normalized to length=1"; end normalizeWithAssert;