A cloud of data has a grain — a direction along which it varies most. Keep only that one axis and you can rebuild most of the cloud from a single number each: the machine sees a hundred dimensions and reconstructs them from a handful. Slide from one component to two (or tap).
Principal Component Analysis on a 2-D point cloud. The covariance matrix's eigenvectors are the axes along which the data varies most; PC1 is the direction of maximum variance, PC2 the leftover. Projecting each point onto the top-k axes and mapping back is the best possible k-dimensional reconstruction (minimum squared error, the Eckart–Young theorem). With k=1 the cloud collapses onto its principal line yet keeps most of its spread; k=2 is exact. The eigenvalues (analytic for 2×2), the variance kept and the reconstruction error are computed live. A fail-loud self-check throws unless PC1 holds more variance than PC2 and k=1 beats projecting onto a wrong axis.
A 2-D cloud stands in for the high-dimensional case where PCA earns its keep; real data is rarely so Gaussian. The covariance, eigen-decomposition and reconstruction error are computed exactly.