yAtlas

正在绘制第一帧……

秩序之下 · No.15 · 实时图版

Linear

线性代数

Plates on matrices and what they do, each one computed in the browser as you watch: linear maps, a sheet of graph paper moved by a two-by-two matrix, whose columns are where the two basis vectors land, whose determinant is the factor by which it multiplies every area, falling through zero as the sheet is pressed onto a line and turned over, and whose eigenvectors are the lines it leaves in place; the cat map, an integer matrix of determinant one applied to a picture on a torus, which stretches it into stripes and then into what looks like noise, until on a grid of 610 by 610 points it brings the picture back, turned half a turn after fifteen steps and exactly after thirty; least squares, the line through three points that makes the total area of the squares on its errors as small as it can be, which in the space of the data is the point of a plane nearest to a point off it, found by a sphere that shrinks until it just touches the plane, the error standing at right angles to both columns of the matrix, and, with the errors measured at right angles to the line, the principal axis of a cloud of points; principal axes, the perpendicular eigenvectors of a symmetric matrix, where its quadratic form is largest and smallest on the unit circle and along which the matrix turns diagonal, with the signs of its eigenvalues deciding whether xᵀSx = 1 is an ellipse or a hyperbola, an ellipsoid or a hyperboloid of one sheet or of two; and singular values, the semi-axes of the ellipse any matrix makes of a circle, the matrix as a turn, a stretch and a turn, the unit sphere pressed flat as the rank falls, and the cat of the second plate rebuilt term by term from the closest matrices of each rank. The corner writes the matrix of the moment, and reads each quantity twice, once from its entries and once from the picture.

图版
I–V
循环
每张 60 秒
分辨率
随播放区域自适应,最高 440 万像素
预先录好的帧
没有
短片
制作中

图版 I · 4 段 · 1:00 循环

Linear maps

A two-by-two matrix A sends each vector x to Ax, and so moves the whole plane at once: lines go to lines, parallel lines stay parallel and evenly spaced lines stay evenly spaced, while the origin stays where it is. Everything about A can be read from a sheet of graph paper after A has moved it. Its columns are where the basis vectors e1 and e2 land; its determinant ad − bc is the factor by which it multiplies every area, negative when it turns the sheet over; its eigenvectors are the directions it does not turn. In every frame the plate pulls each pixel back through the inverse of A to find which point of the sheet lands there; the corner writes A and reads each quantity twice, once from its four entries and once from the picture.

图版

说明

The matrix in the corner

Each plate is a matrix at work, and the corner writes the matrix of the moment, its entries recomputed in every frame. Beneath it each quantity is read twice: once from the entries, as the determinant ad − bc, the roots of the characteristic polynomial or the Fibonacci numbers in a power of the cat map; and once from the picture, as the area of the parallelogram drawn on screen, the stretch measured along a line found from the definition of an eigenvector, or the grid points counted one by one that are back in place.

Pulling back

A shader cannot push the points of a sheet forward to where a matrix sends them, but it can ask, at every pixel, which point of the sheet lands there, by applying the inverse matrix. The grid lines are drawn where that point has a whole-number coordinate, a pixel wide whatever the matrix does to them, and where they crowd closer than a few pixels they fade into an even tint, as they do when the sheet is pressed flat.

Computed, not stored

Nothing on screen is precomputed. The cat map runs on a grid of 610 × 610 points in whole numbers: after n steps each grid point takes the colour of the grid point that the inverse of the nth power of the matrix, reduced modulo 610, sends it to, so nothing is rounded and the picture comes back exactly. The eigenvalues of the symmetric matrices come from Jacobi rotations, which zero the largest off-diagonal entry again and again, and the singular value decomposition of the 96 × 96 matrix of the cat from one-sided Jacobi rotations, which turn its columns two at a time until they are perpendicular, all in double precision in the browser.