({{, (RefLink[Normalize, paclet:ref/Normalize])[v] 
gives the normalized form of a vector v. }, {, (RefLink[Normalize, paclet:ref/Normalize])[z]
gives the normalized form of a complex number z.}, {, (RefLink[Normalize, paclet:ref/Normalize])[expr,f]
normalizes with respect to the norm function f.}})

OpenersNotesSection(Spacer1)Details

(RefLink[Normalize, paclet:ref/Normalize])[v] is effectively v/(RefLink[Norm, paclet:ref/Norm])[v], except that zero vectors are returned unchanged.

Except in the case of zero vectors, (RefLink[Normalize, paclet:ref/Normalize])[v] returns the unit vector in the direction of v.

For a complex number z, (RefLink[Normalize, paclet:ref/Normalize])[z] returns z/(RefLink[Abs, paclet:ref/Abs])[z], except that (RefLink[Normalize, paclet:ref/Normalize])[0] gives 0.

(RefLink[Normalize, paclet:ref/Normalize])[expr,f] is effectively expr/f[expr], except when there are zeros in f[expr].

OpenersPrimaryExamplesSection(Spacer1)Examples  (10)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Normalize[{1,5,1}]

OpenersExampleSection1(Spacer1)Scope  (5)

Symbolic vectors:

Normalize[{x,y}]

Use an arbitrary norm function:

Normalize[{x,y},f]

v is a complex-valued vector:

v = {1,2 I,3,4 I,5,6I};

Normalize using exact arithmetic:

Normalize[v]

Use machine arithmetic:

Normalize[N[v]]

Use 24-digit precision arithmetic:

Normalize[N[v, 24]]

Normalize a sparse vector:

s = N[SparseArray[Table[{2^i}->i,{i, 20}]]]

Normalize[s]

ArrayRules[%]

Normalize a (RefLink[TimeSeries, paclet:ref/TimeSeries]):

ts=TimeSeries[{1,2,3},{.1,.3}];

ts["Path"]

Norm[ts["Values"]]

nts=Normalize[ts]

nts["Path"]

Norm[nts["Values"]]

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (2)

Normalize a matrix by explicitly specifying a norm function:

Normalize[{{1,2},{4,5}},Norm]

Normalize a polynomial with respect to integration over the interval -1 to 1:

Normalize[1+x+x^2,Integrate[#^2,{x,-1,1}]&]

OpenersExampleSection4(Spacer1)Applications  (1)

m is a symmetric matrix with distinct eigenvalues:

m = {{1,2,3},{2,4,5},{5,3,1}}

Power method to find the eigenvector associated with the largest eigenvalue:

v = FixedPoint[Normalize[m.#]&, RandomReal[1,{3}]]

This is consistent (up to sign) with what (RefLink[Eigenvectors, paclet:ref/Eigenvectors]) gives:

Eigenvectors[N[m],1]

The eigenvalue can be found with (RefLink[Norm, paclet:ref/Norm]):

Norm[m.v]

OpenersExampleSection5(Spacer1)Properties & Relations  (1)

v is a random vector:

v = RandomReal[{-1,1}, 2]

u is the normalization of v:

u = Normalize[v]

u is a unit vector in the direction of v:

Show[Graphics[{Circle[{0,0},1],{Thickness[0.025], Arrow[{{0,0}, u}]}, {Green, Thickness[0.0125],Arrow[{{0,0}, v}]}}]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Norm, paclet:ref/Norm])  ▪  (RefLink[Abs, paclet:ref/Abs])  ▪  (RefLink[Dot, paclet:ref/Dot])  ▪  (RefLink[Sign, paclet:ref/Sign])  ▪  (RefLink[UnitVector, paclet:ref/UnitVector])  ▪  (RefLink[Standardize, paclet:ref/Standardize])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Vector Operations, paclet:tutorial/VectorOperations])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Calculus, paclet:guide/Calculus])}, {▪(RefLinkPlain[Operations on Vectors, paclet:guide/OperationsOnVectors])}, {▪(RefLinkPlain[Data Transforms and Smoothing, paclet:guide/DataTransformsAndSmoothing])}, {▪(RefLinkPlain[Math & Counting Operations on Lists, paclet:guide/MathematicalAndCountingOperationsOnLists])}, {▪(RefLinkPlain[Matrices and Linear Algebra, paclet:guide/MatricesAndLinearAlgebra])}, {▪(RefLinkPlain[Differential Equations, paclet:guide/DifferentialEquations])}})}})