Ok, this is a general algorithm question, not necessarily perl related. This isn't the actual problem I have but this is a simple analog. Basically, I need to place labels in a nice way on a circle. Suppose you have a round clockface. You want to label the clock with words instead of numbers.
So, 3 o'clock is easy. The label "three" placed with the 't' maybe just a bit to the right of the circle directly at pi/4 radians. Similarily, nine o'clock is placed at its spot but with the 'e' on the circle and the first 'n' offset to the left a bit.
Those are the easy ones though. How would one, position the "eleven"? My first thought is to consider the labels as boxes. If I define a line tangent to the circle that part of that line could define one end of the box, the other end is a line parallel to it and the sides two perpendiculars. But this seems maybe overly complicated. Then again, it would allow for the label to be any size...just adjust the dimensions of the box.
This seems like the sort of thing that there must be a well known algorithm for. Is there? Google seems a bit useless but maybe I don't know the right keyword to use here.
Any advice?
In reply to algorithm help -- how to label a clock by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |