Rotations in a 2D plane are mostly understood either through a matrix or through complex numbers.
Rotations in 2D can be fully described by center and angle of rotation.
A vector when becomes . Expanding with the angle-sum identities:
which we can regroup as a matrix acting on the original vector:
This implies that the rotation matrix is . Refer to this article for two different ways to derive this matrix step-by-step.
A complex number (where is the imaginary number i.e. ) can be thought of as an ordered tuple of two numbers a and b. This tuple (a,b) can be used to represent the point in the 2D plane. Since we know how to multiply two complex numbers, and we know how to visualize a complex number as a 2D vector, we can visualize the multiplication of two 2D vectors.
Now consider a special class of imaginary numbers: . Multiplying this with any complex number gives:
Reading the real and imaginary parts as the coordinates of a vector, this is exactly a rotation matrix acting on the original vector:
Therefore, to rotate any vector by an angle , we convert the vector into the corresponding complex number , multiply it by the complex number and then convert the product (which is also a complex number) back to a vector. This is the reason why complex numbers are used to represent rotations in many applications.
Here is itself a complex number. Multiplying it by gives , the point rotated by .
Here we show (not prove) visually that the complex number . Note that
Substituting gives
Let's map the sum of these terms to the complex plane (which is a 2D plane). As we include more and more terms, . This point is .
Thus, multiplying to a complex number is equivalent to rotating the vector by an angle .
A 2D rotation matrix has one free variable. In other words, if we know just one entry of the matrix, we can calculate the rest of the entries.
Just from the , you can derive the entire rotation matrix. updates the matrix as well.
It also aligns with the fact that the complex exponential has one free variable . The number of free variables for rotation in n-dimensional space will come in handy later in this series.