how to write a function of image rotation

how to write a function of image rotation by using the following f is the input image, (x0,y0) is the rotating center & a is the rotating angle. Return value is the output image (using IM & Bilinear interpolation);