controversy from how to rotate curve thread

i have a problem with the equations i was given for curve rotation from/about origin.In the following w1 is the angle between curve and x axis,w2 is the angle the curve is rotated by counterclockwise

y1=rsinw1

x1=rcosw1

sin(w1+w2)=y2/r

y2=rsin(w1+w2)

cos(w1+w2)=x2/r

x2=rcos(w1+w2)

but

sin(w1+w2)=sinw1cosw2+cosw1sinw2

cos(w1+w2)=cosw1cosw2+sinw1sinw2

therefore

y2=rsinw1cosw2+rcosw1sinw2

y2=y1cosw1+x1sinw2

but i was told

$\displaystyle

y2=y1cosw1-x1sinw2

$

this is quite confusing!