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

Username:   Password: 
 RegisterRegister   
 Analog 60 second timer- How to make the hand rotate
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mballaz




PostPosted: Sun Apr 05, 2009 3:06 pm   Post subject: Analog 60 second timer- How to make the hand rotate

Hi, i'm new to turing and i was wondering how i can make a hand on the 60 second analog timer rotate if the center of the clock would be at the center of the screen. the size of the circle doesn't really matter.
Thanks
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Apr 05, 2009 3:10 pm   Post subject: RE:Analog 60 second timer- How to make the hand rotate

You know one point (center), length of the hand, and the angle (time). Calculate the location of the second point, and draw a line in between.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
saltpro15




PostPosted: Sun Apr 05, 2009 3:11 pm   Post subject: Re: Analog 60 second timer- How to make the hand rotate

use for loops and the drawline command
tjmoore1993




PostPosted: Sun Apr 05, 2009 3:18 pm   Post subject: Re: RE:Analog 60 second timer- How to make the hand rotate

Tony @ Sun Apr 05, 2009 3:10 pm wrote:
You know one point (center), length of the hand, and the angle (time). Calculate the location of the second point, and draw a line in between.




360 / 60 = 6

1 second = 6 degrees

Equation(Linear)
D=6s
D=6(60)
D=360

60=6s
s=6/60
s=10
mballaz




PostPosted: Sun Apr 05, 2009 4:33 pm   Post subject: Re: Analog 60 second timer- How to make the hand rotate

i was hoping it would be like the rotating house example, so that i wouldn't need to redraw the line
DanielG




PostPosted: Sun Apr 05, 2009 5:05 pm   Post subject: RE:Analog 60 second timer- How to make the hand rotate

there are probably commands you can use, however, the things mentioned above combined with simple trig should be more than enough.
Zren




PostPosted: Mon Apr 06, 2009 3:03 pm   Post subject: Re: Analog 60 second timer- How to make the hand rotate

mballaz @ Sun Apr 05, 2009 4:33 pm wrote:
i was hoping it would be like the rotating house example, so that i wouldn't need to redraw the line


So you would rather redraw a picture? Either way, to animate something you'll have to redraw something.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: