Exercise 3: Mapping Each Worked-Project Step to Its Linear Algebra Topic — Possible Solution ==================================================================================== STEP 1: FACING DIRECTION AND DETECTION ANGLE — VECTORS & THE DOT PRODUCT (CHAPTER 2) ------------------------------ Computing the angle between two directions using a dot product and each vector's own magnitude is exactly Chapter 2's own dot-product- to-angle formula, applied to a facing vector and a direction-to- player vector. STEP 2: DECIDING WHICH WAY TO TURN — THE CROSS PRODUCT (CHAPTER 3) ------------------------------ Using the sign of a1b2 - a2b1 to decide whether one direction is clockwise or counter-clockwise from another is Chapter 3's own 2D pseudo-cross-product, used here for a genuinely practical AI-turning decision rather than an abstract calculation. STEP 3: COMBINING A FLIP AND A SCALE — MATRIX MULTIPLICATION (CHAPTER 4) ------------------------------ Combining two separate transformations into one by multiplying their matrices together - and specifically needing the real row-by-column rule rather than entry-wise multiplication - is Chapter 4's own core subject. STEP 4: PLACING THE SPRITE IN THE WORLD — HOMOGENEOUS TRANSFORMS (CHAPTER 5) ------------------------------ Packaging a linear transformation together with a translation into a single matrix, using an extra row/column and a constant 1 appended to each vector, is exactly Chapter 5's own homogeneous-coordinates technique. STEP 5: SOLVING FOR CALIBRATION CONSTANTS — SYSTEMS OF LINEAR EQUATIONS (CHAPTER 6) ------------------------------ Finding two unknown constants (a slope and an intercept) from two known data points, by setting up two equations and eliminating one variable, is a direct application of Chapter 6's own Gaussian elimination. STEP 6: UN-CLICKING BACK TO LOCAL SPACE — THE DETERMINANT & MATRIX INVERSE (CHAPTER 7) ------------------------------ Checking a transform isn't degenerate via its determinant, then using its inverse to reverse the transform and recover an original point, is exactly Chapter 7's own determinant-and-inverse material. STEP 7: CHECKING THE INPUT SCHEME FOR REDUNDANCY — LINEAR INDEPENDENCE & RANK (CHAPTER 8) ------------------------------ Row-reducing a set of direction vectors to discover that one of them is just the sum of the other two, and concluding the set's true rank is lower than its count, is Chapter 8's own linear-independence and rank technique. STEP 8: FINDING THE DIRECTION OF MAXIMUM CLICK SPREAD — EIGENVALUES & EIGENVECTORS (CHAPTER 9) ------------------------------ Computing the eigenvalues and eigenvectors of a covariance matrix to find the direction capturing the most variance in a dataset - and using a zero eigenvalue to justify a lossless dimensionality reduction - is precisely Chapter 9's own PCA application. WHY THIS WORKS AS AN ANSWER ------------------------------ Each step is matched to its topic by identifying the specific mathematical operation actually being performed in that step's own description - an angle calculation, a turn-direction sign test, a matrix product, a homogeneous transform, a linear system, a determinant/inverse pair, a rank calculation, and an eigenvalue decomposition - rather than simply repeating the chapter numbers already given in the original worked project.