Type the displacement (u, v) of every point as a function of position, or choose a preset, and see how a lattice, a square and a circle deform. When the gradient of the displacement is the same everywhere the deformation is affine; when it varies from place to place it is non-affine.
X, Y, L (a fixed half-width of 250), k1 and k2; the functions sin, cos, tan, asin, acos, atan, atan2, sqrt, abs, exp, log, log10, pow, min, max, floor, ceil, round; the constants pi and e; and ^ for powers. The formatted equation and the four displacement gradients are shown under the boxes.The lattice shows the raw displacement field. For the square and the circle, n points are sampled along the perimeter, each is moved by the same (u, v) field, and they are reconnected in order, which shows how the point-by-point deformation changes the shape of a whole object.
A deformation is described by the displacement \(\mathbf{u}(\mathbf{X})=(u,v)\) of each point from its original position \(\mathbf{X}=(X,Y)\). The local deformation is measured by the displacement gradient:
Affine deformation. If the displacement is a linear function of position, the gradient has the same value at every point. Straight lines stay straight, parallel lines stay parallel, and every part of the body, however small, is deformed in the same way as the whole. The stretches, shears and rotation in the first menu are of this kind. The stretching and shearing is the symmetric part \(\varepsilon_{ij}=\tfrac12(e_{ij}+e_{ji})\) of the gradient, and the rigid rotation is its antisymmetric part.
Non-affine deformation. If the displacement is not linear, the gradient depends on position. Lattice lines bend, and the neighbourhood of one point is deformed differently from that of another. The square and circle show how this alters the overall shape of an object: a square becomes curved, and a circle is no longer an ellipse. (An affine map takes a circle to an ellipse and a square to a parallelogram.)
In a crystal, the elastic deformation of a perfect lattice is affine, to a good approximation. In an amorphous solid or a defective crystal, the atoms do not follow the macroscopic strain exactly, and each atom has an extra, non-affine, displacement that relaxes the local forces. These non-affine displacements are important in the elasticity and the plastic flow of glasses, and in the elastic moduli of materials with a complicated unit cell. The displacement fields here are a simple way of seeing how a displacement that is not a linear function of position distorts an arrangement of atoms.
The gradient shown in the four boxes is calculated symbolically from the equations typed in, so you can read off where it is constant (affine) and where it depends on position.