liveBook · Manning

Geometric transformation

As explained in Geometry for Programmers

A mapping that changes the position, orientation, size, shape, or other geometric properties of an object.

A geometric transformation maps points in a geometric space to points in that same space. Applied to every point of an object, it describes a change to the object by describing how the surrounding space changes. Translation, rotation, scaling, shear, and projection are useful special cases. section 4.1 section 4.0

Think of a transformation as a point-moving rule rather than a property of one shape. The rule may be written as coordinate functions, vector equations, or matrices; the representation should suit the task. In homogeneous coordinates, a projective transformation can express translation, rotation, scale, and shear as matrix multiplication. section 4.1 section 4.3.3

Matrix-based transformations are particularly practical because they can:

  • Compose a sequence of changes into one matrix; associativity also permits parallel composition. section 4.3.3
  • Represent an identity transformation and an inverse that undoes a transformation. section 4.3.3
  • Avoid unnecessary framework overhead when direct mathematical implementation is appropriate. section 1.3

Page projection and unbending

A flat photographed page can be projected by transforming one quadrilateral into another. A bent page needs a nonlinear transformation instead: cubic interpolation along the bent x direction and linear interpolation along the straight y direction map a standard square onto the photographed page. Composing that mapping with a page-to-square mapping determines pixel colors for an unbent result. section 1.3 section 8.1.3

Transformations also provide a direct way to think about surfaces. A 3D function maps each point of space to another point; restricting it to a plane turns that plane into a surface. Parameterizing the input plane with u and v yields a surface function f(u, v) → (x, y, z), suitable for deformative modeling and interpolation. section 8.2.1 section 8.6

Figure 8.8 The book photo and an example unbent page
08-08

Compare a photographed curved page with its unbent result to see why a projective mapping alone cannot model page curvature. section 8.1.3

How Geometry for Programmers covers it

How deep it goes
Defines point-to-point mappings, develops projective matrix composition and inverses, then extends transformations to nonlinear page unbending and surfaces.
Examples
Uses quadrilateral page projection, curved-page unbending with linear-cubic interpolation, plane-to-surface mapping, vector translation, and vector scaling.
What it assumes
Introduces transformations through point mappings and intuitive geometric operations without requiring advanced mathematical background.
What you can do after
Build it from scratch as matrix-based or interpolated point mappings when framework routines are insufficient or inefficient.
How it connects
Connects matrix multiplication, homogeneous coordinates, projective space, vector addition, scalar multiplication, polynomial interpolation, and surfaces.

Also explained in

Compare how 2 books explain geometric transformation →

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.