Exercise 2: Why the Dot Product Alone Can't Tell Clockwise From Counterclockwise — Possible Solution ==================================================================== COMPUTING THE ANGLE ------------------------------ v1 = (0,1), v2 = (1,0). Dot product: v1·v2 = (0)(1) + (1)(0) = 0. |v1| = 1, |v2| = 1. cos(theta) = 0 / (1*1) = 0 theta = arccos(0) = 90 degrees. So the angle between v1 and v2 is exactly 90 degrees. WHY THE DOT PRODUCT ALONE DOESN'T REVEAL DIRECTION ------------------------------ The dot-product formula, cos(theta) = (a·b)/(|a||b|), only recovers the COSINE of the angle between two vectors. Cosine is an even function - cos(theta) = cos(-theta) for any angle theta - which means a 90-degree clockwise rotation and a 90-degree counterclockwise rotation produce the exact same dot product and therefore the exact same computed angle. Rotating v1=(0,1) by +90 degrees or by -90 degrees both land on a vector perpendicular to v1, and the dot product formula has no way to distinguish which of the two perpendicular directions was actually reached, because both give a dot product of exactly 0 with v1. WHAT ACTUALLY DISTINGUISHES THE TWO CASES ------------------------------ The 2D cross product (technically the z-component of the 3D cross product when both vectors lie in the xy-plane), v1.x*v2.y - v1.y*v2.x, carries a SIGN that the dot product's cosine formula throws away. For v1=(0,1) and v2=(1,0), this cross-product value is (0)(0) - (1)(1) = -1, a negative number, which indicates v2 is rotated clockwise from v1 (using the standard mathematical convention where a positive cross-product value indicates counterclockwise rotation). If v2 had instead been (-1,0) - the vector reached by rotating v1 counterclockwise by 90 degrees instead - the dot product would give the identical 90-degree angle, but the cross product would flip sign to +1. WHY THIS WORKS AS AN ANSWER ------------------------------ The answer computes the requested angle correctly and precisely, and explains the specific mathematical reason (cosine's evenness, discarding sign information the cross product retains) that the dot product cannot distinguish rotational direction, rather than simply asserting that "the dot product doesn't have direction information."