liveBook · Manning

Vector normalization

As explained in Geometry for Programmers

Normalization is the property or operation of making a vector have length one.

Vector normalization is the operation or property of making a vector have length one. In a basis, normalized vectors provide a consistent unit scale; when they are also perpendicular, the basis is orthonormal. A basis need not be normalized or orthogonal when another coordinate system is more useful. section 2.1.2

For a curve, direction and length solve different problems. Partial-derivative ratios determine a tangent line, while derivative magnitudes determine tangent-vector length. Choosing normalized, pixel-proportional tangents prevents oversized handles from distorting an otherwise smooth contour. section 12.4.4

Taming a contour

The tangent vectors (dx, dy) = (1, 2) and (2, 4) point along the same tangent line, but the latter is twice as long. Normalizing the tangent vectors keeps the curve smooth while removing unwanted loops caused by disproportionate lengths. section 12.4.4

Figure 12.22 Exaggerated tangent vectors spoil the contour. It’s still technically smooth and continuous, though.
12-22

Compare an exaggerated tangent construction with its normalized counterpart to see why direction alone does not guarantee a well-shaped contour. section 12.4.4

Figure 12.23 By normalizing tangent vectors, we keep the contour smooth, but the unwanted loops are gone.
12-23

Use the normalized-contour figure to see how unit-length-aware tangents preserve smoothness and remove unwanted loops. section 12.4.4

How Geometry for Programmers covers it

How deep it goes
Defines unit length and applies normalization to tangent vectors, but gives no detailed normalization formula or implementation procedure.
Examples
Uses derivative pairs, pixel-sized contour tangents, orthonormal coordinate bases, and triangle-edge coordinate systems as examples.
What it assumes
Assumes basic vectors and partial derivatives, while introducing normalized and orthonormal basis terminology in accessible terms.
What you can do after
Apply normalization to keep contour tangents proportionate, smooth, and less likely to create unwanted loops.
How it connects
Connects normalization with tangent vectors, curves, partial derivatives, basis vectors, orthonormal bases, and ray-casting.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.