Hi.
I'm just trying to make a simple analogue clock as I learn to use TKinter with python. I need to know the maths behind calculating the x, y values for drawing the end of the hands.
I don't need to post the whole program, all you need to see how I've done what I've got of the stuff you need to know (draws breath), is right here:
- I'm using the 'datetime' module for getting seconds, minutes and hours
- Have a canvas of size (300, 300) inside a window also (300, 300)
- The clock circle bounding box is (5, 5, 295, 295)
- I want to draw the hands as different lengths, so not quite as far as the edge of the clock circle.
- Hands originate from (150, 150)
- I only need to know how to calculate the end x and y values for the hands (eg. [origin_x, origin_y, end_x, end_y)
Thanks for your time!