I don't know that you can rotate an image using cosine alone, and I don't know how your image is coded, but maybe you can translate this into something you can use.
Suppose a given point of your image is coded as a row vector [x y], if you want to rotate that point through an angle of [itex]\theta[/itex] radians clockwise about the origin, you can multiply
[tex]
[x \; y] \times \left [ \begin{array}{lr} cos(\theta) \quad &-sin(\theta) \\<br />
sin(\theta) &cos(\theta) \end{array} \right ][/tex]
to get the new coordinates for that point. For example, the point [1 2] rotated [itex]90^o[/itex] ([itex]\frac{\pi}{2} \, radians[/itex]:
[tex]
[ 1\quad 2] \times \left [ \begin{array}{lr} cos(\frac{\pi}{2}) \quad &-sin(\frac{\pi}{2}) \\<br />
sin(\frac{\pi}{2}) &cos(\frac{\pi}{2}) \end{array} \right ] = [2 \;-1][/tex]
So you can multiply each point of your image by the same matrix and the entire image will be rotated.