|
|
I'm assuming you want the hour hand to look right? Like, if it's 12:30, the hour hand is between the 12 and the 1?
It's been about 5 years since I programmed anything, but I assume the easiest thing to do would be:
1) Turn the time into a number of minutes past 12:00. If h is the hour and m is the minutes, this is 60*h+m, which I'll call H.
2) Each minute is 6 degrees apart, so you're interested in 6H, and 6m.
3) (I'm assuming your computer's trig functions want degrees, and not radians.) If the length of the clock hand is r, then for the hour hand, your coordinates are x=r*cos(-H+90), y=r*sin(-H+90), and for the minute hand, your coordinates are x=r*cos(-m+90), y=r*sin(-m+90).
At least, I think so =) |
|
|