Exercise 2: Why R^-1=R^T Holds for Rotation but Not for Scaling — Possible Solution ==================================================================== WHY IT HOLDS SPECIFICALLY FOR ROTATION MATRICES ------------------------------ This chapter's own explanation traces the R^-1=R^T shortcut back to Chapter 4's dot-product orthogonality checks: a rotation matrix's rows (and columns) are mutually perpendicular UNIT vectors - each row has length exactly 1, and any two different rows have a dot product of exactly 0. This specific structural property (orthonormal rows) is precisely what makes a matrix's transpose equal to its inverse: when you multiply an orthonormal matrix by its own transpose, each entry of the result is a dot product between two of the original rows - the diagonal entries become each row's own length squared (which is 1, since they're unit vectors), and the off-diagonal entries become dot products between different, perpendicular rows (which are 0) - giving exactly the identity matrix, which is the defining property of an inverse. WHY THIS FAILS FOR A SCALING MATRIX ------------------------------ A matrix that stretches an object twice as wide as it is tall (for example, a 2D scaling matrix like [[2,0],[0,1]]) does not have unit- length rows - its first row, (2,0), has length 2, not 1. Since the rows are no longer unit vectors, multiplying the matrix by its own transpose no longer produces the identity matrix: for this example, M * M^T = [[2,0],[0,1]] * [[2,0],[0,1]] = [[4,0],[0,1]], which is clearly not the identity matrix. The actual inverse of this scaling matrix is [[0.5,0],[0,1]] - the reciprocal of each scale factor - a completely different matrix from its transpose (which, since the matrix happens to be symmetric in this particular example, is actually identical to the original matrix itself, not its inverse). THE GENERAL PRINCIPLE ------------------------------ The R^-1=R^T shortcut is not a general property of all matrices - it is specifically a consequence of a matrix's rows/columns being orthonormal (mutually perpendicular unit vectors), which is exactly what characterizes a pure rotation (and reflection) matrix and nothing else. Any transformation that also scales, shears, or otherwise distorts lengths breaks this property, and requires a genuine matrix inversion (of the kind Numerical Methods & Floating- Point Computation's own Chapter 8 covered) instead of the cheap transpose shortcut. WHY THIS WORKS AS AN ANSWER ------------------------------ The explanation identifies the precise structural property (orthonormal rows) that makes the shortcut valid, demonstrates concretely with a specific scaling matrix why that property fails once scaling is introduced, and generalizes to the correct broader principle (the shortcut applies to orthonormal transformations specifically, not matrices in general).