Navigation

Operators and Keywords

Function List:

C++ API

Function File: vn = normalizeVector (v)

Normalize a vector to have norm equal to 1 Returns the normalization of vector v, such that ||v|| = 1. v can be either a row or a column vector. When v is a MxN array, normalization is performed for each row of the array. Example:

             vn = normalizeVector([3 4])
             vn =
                 0.6000   0.8000
             vectorNorm(vn)
             ans =
                 1

See also: vectors2d, vectorNorm.

Package: geometry