math rotation formula...
Author |
Message |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 04, 2003 3:49 pm Post subject: math rotation formula... |
|
|
k... here's the problem I need a formula or procedure that would get OriginX,OriginY,SecondparX,SecondparY,Angle and then caclulate the SecondparX and SecondparY rotated By Angle
please help... ASAP |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 04, 2003 3:51 pm Post subject: (No subject) |
|
|
i know
Y = R*Sin(deg)
X = R*Cos(deg)
and
radius^2 = X^2 + Y^2
But i cant get them to do what i want...
I have tried a procedure that would get
OriginX,OriginY,radius,Angle as well but i cant work it HEEEEEELP!!!!!!!!!!!!!!!!!!!!!!!! |
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 04, 2003 4:36 pm Post subject: (No subject) |
|
|
WHOOHOOO!!!!!!!!!!!!!!
I solved it took me an hour to work the formula...
But at last
code: | procedure rotate (OriginX, OriginY : int, var secondpartX, secondpartY : real, Rotaion : int)
var tempx := (((OriginX - secondpartX) * cosd (Rotaion)) + ((OriginY - secondpartY) * sind (Rotaion)))
var tempy := (((OriginY - secondpartY) * cosd (Rotaion)) - ((OriginX - secondpartX) * sind (Rotaion)))
secondpartY := OriginY - tempy
secondpartX := OriginX - tempx
end rotate |
|
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 04, 2003 4:46 pm Post subject: (No subject) |
|
|
here's a pretty demo of how it works:
code: | procedure rotate (OriginX, OriginY : int, var secondpartX, secondpartY : real, Rotaion : real)
var tempx := (((OriginX - secondpartX) * cosd (Rotaion)) + ((OriginY - secondpartY) * sind (Rotaion)))
var tempy := (((OriginY - secondpartY) * cosd (Rotaion)) - ((OriginX - secondpartX) * sind (Rotaion)))
secondpartY := OriginY - tempy
secondpartX := OriginX - tempx
end rotate
var col := 1
var i := .0
var secondpartX, secondpartY := 500.0
secondpartY := 200
loop
rotate (320, 200, secondpartX, secondpartY, .01)
i += .01
drawline (320, 200, round (secondpartX), round (secondpartY), col)
if i >= 30 then
col += 1
i := 0
end if
end loop |
|
|
|
|
|
![](images/spacer.gif) |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Sun May 04, 2003 5:22 pm Post subject: (No subject) |
|
|
how are you using glow in your text? |
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 04, 2003 5:25 pm Post subject: (No subject) |
|
|
is it not allowed? =/ |
|
|
|
|
![](images/spacer.gif) |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Sun May 04, 2003 5:27 pm Post subject: (No subject) |
|
|
well no one has done it before so I'll assume we didn't make a decision on it. PM me with how you did that. (I'll need to exploit test glow system) |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Sun May 04, 2003 10:00 pm Post subject: (No subject) |
|
|
i am sprised no one eltes figered it out yet, lol
oh well as lonjg was you dont over do it ![Wink Wink](http://compsci.ca/v3/images/smiles/icon_wink.gif) |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 04, 2003 10:04 pm Post subject: (No subject) |
|
|
heh!
i was trying to work some dhtml on my text to make it really fancy but for some reason javascript doesn't work only straight html... =/ |
|
|
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Sun May 04, 2003 10:25 pm Post subject: (No subject) |
|
|
Homer_simpson wrote: heh!
i was trying to work some dhtml on my text to make it really fancy but for some reason javascript doesn't work only straight html... =/
that is so no one will wirte somting in javascript that will mess over the fourm or piss peopeop off. also not all html will wrok... |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 04, 2003 10:52 pm Post subject: (No subject) |
|
|
what ever you say dan =Þ
Hail the admins... HAIL.... 8) |
|
|
|
|
![](images/spacer.gif) |
|
|