English
The normalize map assigns to a vector x its unit direction, namely normalize(x) = ‖x‖⁻¹ · x, with the natural convention normalize(0) = 0.
Русский
Карту нормирования применяют к вектору x, чтобы получить единичный вектор в том же направлении: normalize(x) = ‖x‖⁻¹ · x, при x=0 принимаем normalize(0)=0.
LaTeX
$$$\\text{normalize}(x) = \\begin{cases} \\frac{x}{\\|x\\|}, & x \\neq 0, \\\\ 0, & x=0. \\end{cases}$$$
Lean4
/-- For a nonzero vector `x`, `normalize x` is the unit-length vector that points
in the same direction as `x`. If `x = 0`, then `normalize x = 0`. -/
noncomputable def normalize (x : V) : V :=
‖x‖⁻¹ • x