Board index » delphi » 2d rotation

2d rotation

Can anybody send source to 2d rotation.

Ari Oinonen

 

Re:2d rotation


Quote
On Sun, 18 Jul 1999 13:05:51 +0300, Ari Oinonen wrote:
> Can anybody send source to 2d rotation.
> Ari Oinonen

Rotation over a point?

   kma = angle

   x` = xorigo + (x-xorigo)*sin(kma) - (y-yorigo)*cos(kma)
   y` = yorigo + (x-xorigo)*cos(kma) + (y-yorigo)*sin(kma)

Somebody correct that if it went wrong.

Notice, this simple case can be useful sometimes too:

   x = radius * cos(kma)
   y = radius * sin(kma)

--
main(C,f,s){for(/** gcc sig.c;a.out>/dev/audio ## http://iki.fi/bisqwit/ **/
write(C=0,"(C)Bisqwit\n",11);f=99;++C){for(s="+%7%+%7%5%4%2%457%0%0%754%2%+"
"%%%5%542%457%0%0%042%2#+%!#0%+%$%%%"[C&63];s--;f=f*89/84);for(s=999+99*(C&2
);--s;putchar(((s*(f-776?f:0)&32767)*s/199999+39-(C&2?rand()%s/24:0))/16));}}

Other Threads