A picture is worth a foreword to continue! ! Matrix multiplication explanation
The coordinates of each pixel according to a rotation angle, converted into pixel coordinates after the rotation angle.
int angle = 45;
int n = 0; n is a vector.
newX [n] = x [n] * cos (angle) - y [n] * sin (angle)
OF NEW [n] = x [n] * sin (angle) + y [n] * cos (angle)