Computer Science Canada

math rotation formula...

Author:  Homer_simpson [ Sun May 04, 2003 3:49 pm ]
Post subject:  math rotation formula...

<span style="width:1000; filter:shadow(color=#B9B7BF, strength=5)">
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

Author:  Homer_simpson [ Sun May 04, 2003 3:51 pm ]
Post subject: 

<span style="width:1000; filter:shadow(color=#B9B7BF, strength=5)">
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 Crying or Very sad HEEEEEELP!!!!!!!!!!!!!!!!!!!!!!!!

Author:  Homer_simpson [ Sun May 04, 2003 4:36 pm ]
Post subject: 

<span style="width:1000; filter:shadow(color=#B9B7BF, strength=5)">
WHOOHOOO!!!!!!!!!!!!!!
I solved it took me an hour to work the formula... Rolling Eyes
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
</span>

Author:  Homer_simpson [ Sun May 04, 2003 4:46 pm ]
Post subject: 

<span class="postdetails"><span style="height:40; filter:glow(color=#FFFF66, strength=10)">here's a pretty demo of how it works:</span>
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

Author:  Asok [ Sun May 04, 2003 5:22 pm ]
Post subject: 

how are you using glow in your text?

Author:  Homer_simpson [ Sun May 04, 2003 5:25 pm ]
Post subject: 

<span style="width:1000; filter:shadow(color=#B9B7BF, strength=5)">
is it not allowed? =/

Author:  Asok [ Sun May 04, 2003 5:27 pm ]
Post 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)

Author:  Tony [ Sun May 04, 2003 5:42 pm ]
Post subject: 

its just a HTML tag... <span style="width:1000; filter:shadow(color=#B9B7BF, strength=5)">See</span>

Author:  Dan [ Sun May 04, 2003 10:00 pm ]
Post subject: 

i am sprised no one eltes figered it out yet, lol

oh well as lonjg was you dont over do it Wink

Author:  Homer_simpson [ Sun May 04, 2003 10:04 pm ]
Post 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... =/

Author:  Dan [ Sun May 04, 2003 10:25 pm ]
Post 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...

Author:  Homer_simpson [ Sun May 04, 2003 10:52 pm ]
Post subject: 

what ever you say dan =Þ
Hail the admins... HAIL.... 8)


: