The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Leng


Unit:SDL_vector
Class:TVector, TIntVector
Declaration:property Leng: double;

The property Leng is a read-only property in the class TIntVector returning the length of the vector. In the class TVector it can be used to both calculate the length of a vector and to set the length of a vector to a given value. Setting the length of a zero-length vector causes an exception ('Vector has zero length'). Note, that setting the length of a vector to 1.0 is equal to normalizing this vector.

 

Example: The statement L := Vec1.Leng; calculates the length of the vector Vec1 and assigns it to the variable L.

Example: This property is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): testvec



Last Update: 2014-Nov-13