Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 math rotation formula...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: 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 Crying or Very sad HEEEEEELP!!!!!!!!!!!!!!!!!!!!!!!!
Homer_simpson




PostPosted: Sun May 04, 2003 4:36 pm   Post subject: (No subject)


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
Homer_simpson




PostPosted: 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
Asok




PostPosted: Sun May 04, 2003 5:22 pm   Post subject: (No subject)

how are you using glow in your text?
Homer_simpson




PostPosted: Sun May 04, 2003 5:25 pm   Post subject: (No subject)


is it not allowed? =/
Asok




PostPosted: 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)
Tony




PostPosted: Sun May 04, 2003 5:42 pm   Post subject: (No subject)

its just a HTML tag... See
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: 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
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Homer_simpson




PostPosted: 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... =/
Dan




PostPosted: 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!
Homer_simpson




PostPosted: Sun May 04, 2003 10:52 pm   Post subject: (No subject)

what ever you say dan =Þ
Hail the admins... HAIL.... 8)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: