3 ms·
One helpful intuition not explicitly stated: To rotate a 2x2 matrix by 90°, you can multiply it by: ┌ ┐ │ 0 -1 │ │ 1 0 │ └ ┘
by anthony_romeo 6y ago
One helpful intuition not explicitly stated:
To rotate a 2x2 matrix by 90°, you can multiply it by:
┌ ┐
│ 0 -1 │
│ 1 0 │
└ ┘
One could reason out how to expand this into 3 dimensions. For example:
┌ ┐
x: │ 0 -1 0 │
y: │ 1 0 0 │
z: │ 0 0 1 │
└ ┘
performs the rotation along the x and y axes.
One could verify that the 2x2 example above is equivalent to:
┌ ┐ ┌ ┐
│ 0 -1 │ = │ cos(θ) -sin(θ) │
│ 1 0 │ │ sin(θ) cos(θ) │
└ ┘ └ ┘
when θ is 90°, and that this formula works for any angle, and the 3D example expands similarly.
When imagining how I want something to rotate, I occasionally find it helpful to start at the first matrix and reason outward from there.