lengthReturn length of a vector (better as norm(), if further symbolic processing is performed) |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
Vectors.length(v);
The function call "Vectors.length(v)
" returns the
Euclidean length "sqrt(v*v)
" of vector v.
The function call is equivalent to Vectors.norm(v). The advantage of
length(v) over norm(v)"is that function length(..) is implemented
in one statement and therefore the function is usually automatically
inlined. Further symbolic processing is therefore possible, which is
not the case with function norm(..).
v = {2, -4, -2, -1}; length(v); // = 5
v |
Type: Real[:] Description: Real vector |
---|
result |
Type: Real Description: Length of vector v |
---|