Need help with 2D algorithm

Im new to game development, and Im trying to make a small 2D game for the iPhone. The game is seen from above (directly, not isometric) and the hero is positioned in the middle of the screen all the time. I have a image as a background, which is a landscape, and this image/background rotates and moves so it looks as the hero is moving around in the landscape. I got the movement working with Phytagoras, but I have a huge problem with the rotation. The problem is that I can not rotate the background around a given point, as the position of the hero, I can only rotate it around the backgrounds own axis, and this is wrong if seen from the heros point of view.

I have tried to figure this out with a combination of Phytagoras and cosinus/sinus, but I cant figure it out. I need some algorithm that can take a angle and then rotate the background relative to the hero position. How do I solve this problem of mine?

I believe the key to this is to translate the background so that the hero's position is moved to the origin (0,0), then do the rotation, then translate the rotated background so that the origin is moved back to the hero's position.

Either way, the general approach is to transform the image such that the point you want to rotate about is at (0,0), and then perform your rotation, and then transform the image back. In GL this is a simple matter of pushing and popping transforms.

What I am doing, is that I have two subviews added to my main view; a background ImageView containing the background image, and a hero ImageView containing the hero image. I then move and rotate the background ImageView to make it look like my hero is moving around in the world. In the following code, the method onTime is called in the game loop repeatedly, and hwew you can see what I am trying:

But all though I do get some different results, none of them worked. One probem I have here is that I do not understand the code you gave me If you can explain the idea behind it, then maybe I can get it working.

Also you mention your own homebrew OpenGL matrix, maybe I should try to in this direction. Can you supply me with some help there? A link to a good tutorial, or maybe some sample code from you in that direction?