• Welcome to Dark Bit Factory & Gravity.
 

math formula..i suck at math..please help :(

Started by .:] Druid [:., July 27, 2007

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

.:] Druid [:.

Hi guys....sorry to bother with a new thread but i really suck at math and i'm tired of searching...this will be pretty simple for most of you:
what is the rotation formula?  if i draw a square or a triangle, how can i rotate it???  thanks in advance for your help
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Shockwave

Around one axis is easy;


theta = angle

xold =  x
yold = y

xnew = cos(theta)*xold - sin(theta)*yold
ynew = sin(theta)*xold + cos(theta)*yold

x=xnew
y=ynew


Hope that helps.
Shockwave ^ Codigos
Challenge Trophies Won:

.:] Druid [:.

wow..that's fast!  i'm gonna try tonight and give you the feedback!  you're my hero..as usual :)
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Shockwave

No worries :)

I just remembered that Emil asked a similar thing (but for rectangles) and I wrote some example code in freebasic, it is here;

http://dbfinteractive.com/index.php?topic=2134.0

So that should get it working for you mate.
Shockwave ^ Codigos
Challenge Trophies Won:

.:] Druid [:.

thanks again!  my bad, i thought i looked over and over on this forum and did not find it...too stoned maybe :s
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.