hi;
i am trying to rotate a bitmap, using the usual equations,
origin: x0,y0
current pixel: x1,y1

rule:
xRotate = cos(angle) * (x1-x0) - Sin(angle) (Y1-Y0) + X0
yRotate = Sin(angle) * (x1-x0) - Cos(angle)(y1-y0) + y0

the problem is that i get yRotate negative, or the point is out of boundaries of the new bitmap!!

can anyone give me a complete alg. to rotate a bitmap?