chrismassey
Programmer
Hello,
I am currently creating an analogue clock using GD. I currently have a square (400px by 400px) and a large circle in the middle.
Each of the 2 clock hands are lines with an xy co-ordinate for one end of the line, and another xy co-ordinate for the other end of the line. To change the hour and minute hand according to GMT time I am going to have to do some pretty complex mathematical equations. the first xy co-ordinate for both clock hands will always be the same (200, 200) as this is the middle of the circle. Then for i.e. the hour hand, I will need to find some sort of relationship between the hour and the position of the other xy co-ordinate. For starters - when hour is 12 or 24, then the other xy co-ordinate is 200, 10 (the middle (x) and 10 down from the top
...
Now this might be pretty complicated, however I was wondering if someone has had to complete a similar task and has got any suggestions or ideas on working out the relationship?
Chris
I am currently creating an analogue clock using GD. I currently have a square (400px by 400px) and a large circle in the middle.
Each of the 2 clock hands are lines with an xy co-ordinate for one end of the line, and another xy co-ordinate for the other end of the line. To change the hour and minute hand according to GMT time I am going to have to do some pretty complex mathematical equations. the first xy co-ordinate for both clock hands will always be the same (200, 200) as this is the middle of the circle. Then for i.e. the hour hand, I will need to find some sort of relationship between the hour and the position of the other xy co-ordinate. For starters - when hour is 12 or 24, then the other xy co-ordinate is 200, 10 (the middle (x) and 10 down from the top
Now this might be pretty complicated, however I was wondering if someone has had to complete a similar task and has got any suggestions or ideas on working out the relationship?
Chris