C
Charles Conlow
Greetings all! I've hit a brain bump here and need a boost...
given this analog clock code (just the hour hand here), where am I missing
the math to move the hour hand along PAST this point? Using this code, it's
drawn AT the hour position, but not PAST it as a real clock does. I'm
thinking too hard about this, perhaps?
Thanks!
Chuck
// draw the HOUR HAND (busted!)
float x_hour = centerx + (int)((centerx * .60) * Math.Sin(2 * Math.PI *
(double)currentTime.Hour / 12));
float y_hour = centery - (int)((centery * .60) * Math.Cos(2 * Math.PI *
(double)currentTime.Hour / 12));
e.Graphics.DrawLine(new Pen(Color.Black,4), centerx, centery, x_hour,
y_hour);
given this analog clock code (just the hour hand here), where am I missing
the math to move the hour hand along PAST this point? Using this code, it's
drawn AT the hour position, but not PAST it as a real clock does. I'm
thinking too hard about this, perhaps?
Thanks!
Chuck
// draw the HOUR HAND (busted!)
float x_hour = centerx + (int)((centerx * .60) * Math.Sin(2 * Math.PI *
(double)currentTime.Hour / 12));
float y_hour = centery - (int)((centery * .60) * Math.Cos(2 * Math.PI *
(double)currentTime.Hour / 12));
e.Graphics.DrawLine(new Pen(Color.Black,4), centerx, centery, x_hour,
y_hour);