The idea: every layer slides by its height

A 3D shear pushes space sideways the way you push a deck of cards lying on a table. The shear parallel to the xy-plane with amounts a and b moves each point (x, y, z) to (x + a·z, y + b·z, z). The height z never changes. A whole horizontal layer z = c slides by the same amount, c·(a, b): the layer at height 1 slides (a, b), the layer at height 2 slides twice as far, and the floor z = 0 does not move at all.

Left: a straight deck, three square layers at heights z = 0, 1 and 2 stacked exactly above each other. Right: after the shear with a = 1, b = 0 the layer at z = 0 has not moved, the layer at z = 1 has slid 1 along x and the layer at z = 2 has slid 2, each still a 1 by 1 square at its own height
With a = 1, b = 0 the layers z = 0, 1, 2 slide 0, 1 and 2 along x. Each layer moves as one piece and keeps its size.

On the canvas the blue box is a deck of two unit cubes, [0, 1] × [0, 1] × [0, 2], with light-blue "cards" between its layers z = 0, 1, 2. The grey box is the deck before the change, the purple arrows show how far the layers z = 1 and z = 2 slid, and the orange letter F on the front face leans over with the deck (Demo: a deck of cards slides by height). Turn View turns the picture about the z-axis so you can look at it from another side.

The matrix: where î, ĵ and k̂ land

The columns of a matrix are where î, ĵ and k̂ land. î = (1, 0, 0) and ĵ = (0, 1, 0) lie on the floor, at height 0, so they do not move. k̂ = (0, 0, 1) is at height 1, so it slides to (a, b, 1). That gives

S=[10a01b001],S[xyz]=[x+azy+bzz]

Row times column: with a = 1, b = ½ and the top corner v = (1, 1, 2) of the deck, row 1 gives 1·1 + 0·1 + 1·2 = 3, row 2 gives 0·1 + 1·1 + ½·2 = 2 and row 3 gives 2. The corner lands at (3, 2, 2): it slid 2·(1, ½) = (2, 1) because it sits at height 2. The point panel on the canvas works this out and flies the three sums into M·v (the black dot).

The volume stays the same: det = 1

The lower unit cube becomes a slanted box, a parallelepiped. Its base is the unit square on the floor, which did not move. Its top slid sideways but stayed at height 1. Same base, same height: the volume is still 1 (Demo: the cube becomes a parallelepiped: same volume). The determinant says the same for every solid: S is triangular, so its determinant is the product of the diagonal, 1·1·1 = 1. It is positive, so the orientation is kept too and the F is not mirrored.

Left: the unit cube with base 1 by 1 and height 1, cut into four thin horizontal slices. Right: its image under the shear with a = 1, b = ½, a slanted box whose four slices have each slid sideways by their height; the base and the height are marked 1 and the slices are the same squares
Cavalieri: every horizontal slice is the same square, only slid, so the slanted box has the same volume as the cube.

This is Cavalieri's principle: two solids whose cross-sections at every height have the same area have the same volume. A shear keeps each horizontal cross-section exactly (it only slides it), so it keeps the volume. The same slicing idea gives the volumes of cones and spheres on Volumes by Slicing.

A fixed plane, and only a plane of eigenvectors

Every point of the floor z = 0 stays exactly where it is: a·0 = b·0 = 0. So every vector in that plane is an eigenvector with λ = 1. Are there more? S − λI is triangular, so det(S − λI) = (1 − λ)³, and λ = 1 is the only eigenvalue, three times. But S − I = [0 0 a; 0 0 b; 0 0 0] sends (x, y, z) to (a·z, b·z, 0), which is 0 only for z = 0. The eigenvectors fill the floor plane and nothing else: two independent directions for an eigenvalue counted three times. There is no basis of three eigenvectors, so a shear (a or b ≠ 0) cannot be diagonalized (Demo: the floor z = 0 stays put: of three test arrows the two in the floor stay, the one above it is pushed off its line).

The floor plane z = 0 drawn in teal with two test arrows in it that do not move. A third arrow, (−1, −1, 1½), points up out of the floor; after the shear with a = b = 1 it becomes (½, ½, 1½), off its old line, drawn dashed
Arrows in the floor z = 0 stay put (λ = 1); an arrow with height slides off its line. The eigenvectors fill exactly that plane.

The inverse is −a, −b

To undo a slide of c·(a, b), slide back by the same amount: S(a, b)−1 = S(−a, −b) = [1 0 −a; 0 1 −b; 0 0 1]. Nothing was squashed (det = 1, not 0), so the shear can always be undone, and its inverse is again a shear (Demo: undo with −a, −b). Two shears by height add their amounts: S(a₂, b₂)·S(a₁, b₁) = S(a₁ + a₂, b₁ + b₂), as you can check with matrix multiplication.

Shears are row operations

Multiplying a matrix A on the left by S adds a times row 3 to row 1 and b times row 3 to row 2. These are the "add a multiple of one row to another" steps of Gaussian elimination, and each one is a shear. That is why those steps never change a determinant: each multiplies it by det S = 1. Elimination below the diagonal uses the lower-triangular shears (row 1 added to rows 2 and 3), which are the same idea with the roles of the coordinates swapped.

The one-axis shear

The simplest 3D shear moves only one coordinate by a multiple of one other: x' = x + a·y, with matrix [1 a 0; 0 1 0; 0 0 1]. It is the 2D shear matrix H(a) acting on every horizontal plane, with z carried along. Now the layers are the planes y = c, each sliding a·c along x, and the fixed plane is y = 0 (it contains î and k̂). Everything else is the same: det = 1, λ = 1 three times with a plane of eigenvectors, inverse with −a. With a = 1 the corner (1, 1, 2) lands at (2, 1, 2) (Demo: shear one axis: x + y).

What a shear keeps and what it changes

PropertyKept by S?Why
volume✓ yesdet = 1
orientation✓ yesdet > 0, the F is not mirrored
every point of the floor z = 0✓ yesa·0 = b·0 = 0
each layer z = c (size and shape)✓ yesit slides as one piece
lines, planes, parallel lines✓ yesevery linear map keeps them
lengths✗ nok̂ becomes (a, b, 1), length √(1 + a² + b²)
angles✗ nothe vertical edges of the deck tilt

See also the overview Linear Transformations, the 2D Shear Matrix and its relative the squeeze mapping (also area-preserving), Determinant, Eigenvectors and Diagonalization, Inverse Matrix, and the other 3D transforms: 3D Rotation Matrix, 3D Reflection Matrix and 3D Projection Matrix. Shears with a shift added are affine transforms, and several maps in a row are on Composing Transforms.

What the page leaves out

Only shears parallel to the xy-plane (amounts −1 to 2 in steps of ½) and the one-axis shear x + a·y are drawn. Shears parallel to other planes (PSP−1, still det = 1), the full family of elementary matrices (row swaps and row scalings, which are not shears), the fact that every rotation is a product of shears (used to rotate images and voxel grids without blurring), the Jordan form [1 1 0; 0 1 0; 0 0 1] that every such shear is similar to, and shear strain in mechanics (how materials deform under sideways forces) are not shown.