Q:

Help with rotating xy-pixel coordinates, unsure about my function

Ok I have a small set of pixels (a character) stored with xy-coordinates. Now I want to rotate the image around its middlepoint with, let's say, a 105 degrees.
Is this the right way to do it?:
Each pixels distance from the middlepoint is its radius.
Then in python code
new_x = avg_pos_x+(math.cos(math.radians(105))*radius)
new_y = avg_pos_y-(math.sin(math.radians(105))*radius)

It seems to work, but then again some pixels appear to be a bit random.
Edit:
Forgot that to rotate each pixel 105 degrees I also calculated the angle between the middlepoint and pixel and added 105 degrees to that.

A:

Looks right. The problem is of accuracy. Pixels near the center get bunched up and pixels far away get spread out.
What you need to do is interpolate the pixels so that it looks smooth. 
e.g., when you rotate a pixel and it ends up half way between one pixel and another but you plot it on one you have an issue when it should really be half on one and half on the other. (if that makes any sense).
Since the screen has discrete pixels you have to determine how much of the original pixel contributes to the new pixel.
You do this by looking at the fractional part of the computed coordinates. Say your new_x is an integer, then you know it contributes all to the pixel. BUT say it has fractional part 0.25. This means some 25% of the pixel is actually in the next location. (depending on how you define the pixel origin)
Since your dealing with 2D is is more complex as you have 8 possible pixels. There are algorithms out that do it differently and may work better(faster) but this method will work.

