liveBook · Manning

Scalar

As explained in Geometry for Programmers

A scalar is a real number that scales a vector or participates in vector operations as a magnitude factor.

A scalar is a single number used with vectors. Multiplying a vector by a scalar multiplies every coordinate: (a1, a2) × d = (a1 × d, a2 × d). Geometrically, this scales the vector: its direction is retained while its length changes by the scalar factor. section 2.1.2 section 9.1

Scale a vector

For c = (1.5, 2), multiplying by the scalar 0.5 gives e = 0.5c = (0.75, 1). The result points in the same direction but is half as long. A vector can also be written as scaled basis vectors: (0.5, 1.5) = 0.5i + 1.5j. section 2.1.2

Figure 9.2 A vector point model is scaled by applying a scalar multiplication to all its vectors.
09-02

Scaling every point vector in a model by one scalar produces a geometric scaling transformation. section 9.1

Scalars help separate vector algebra from ordinary array handling. A vector may look like an array of numbers, but its algebra defines meaningful operations such as vector addition and scalar multiplication. Matrices have their own algebra as well; vectors and matrices can both be described more generally as tensors. section 2.5.2

Scalars also appear as results of vector operations:

  • A dot product turns two vectors into a scalar. For (2, 3, 4) · (5, 6, 7), the scalar result is 2×5 + 3×6 + 4×7 = 56. section 9.2.1
  • A triple product takes three vectors and produces a scalar, unlike a cross product, which produces a vector. section 9.1
  • A scalar k can scale a perpendicular vector: if a = (xa, ya), then (kya, -kxa) is orthogonal to a. section 5.3.2

In applied geometry, scalar multiplication is useful because it turns algebra into a direct transformation: add one vector to all point vectors to translate a model, or multiply all point vectors by a scalar to scale it. Dot products then provide scalar values for tasks such as expressing orthogonality and reasoning about projections. section 9.1 section 5.3.2 section 9.2.1

How Geometry for Programmers covers it

How deep it goes
Defines scalar multiplication coordinate by coordinate and connects it to scaling, basis vectors, dot products, and orthogonality.
Examples
Uses half-scaling of (1.5, 2), basis expansion of (0.5, 1.5), model scaling, and a dot product yielding 56.
What it assumes
Teaches scalars from a single-number definition while assuming only coordinate-vector notation for the worked operations.
What you can do after
Evaluate/understand scalar multiplication as geometric scaling and recognize scalar outputs from dot and triple products.
How it connects
Connects scalars with vectors, basis vectors, matrices, tensors, dot products, cross products, triple products, orthogonality, and projections.

Also explained in

Compare how 4 books explain scalar →

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.