Rotating a 2D Matrix

Hi all,

I wonder if there is an easy way to map the content of one 2D array into another one while rotating the content.

I need it for a circular fade on a RGB LED matrix.

The only idea / work arround I have so far is to read one line of the orginal (with a known lenght) and than use the Bresenham line alorithm:

-calculate the lenght of the new rotated line (new_leghth)
-interpolate the color informations from lenght to new_lenght
-draw the line based on the color data in new_lenght
-continue with the next line

I have serious doubts, that that will be performant. And it will not cover all points.

Any other abstract idea or concept, how to rotate an image (in small steps)? Or even a library?

Thanks in advance for any inspiration!

Rotating what size 2D array? About what point? What angle?

Right now I use a 16x16 setup.

Rotating point: centre.

Angle: Let's say 64 steps for a full circle. Small enough, that a complete rotation appears "soft".

Just a video, what it is about:

Here I described a spiral in the shape of a square for the fade out. With 90 degree angles only it's all easy...

Or maybe someone has a link, where the math behind texture mapping is explained?