Message Boards Message Boards

0
|
2672 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Get formula to calculate text rotation angle (clock angle problem)?

Posted 5 years ago

Hello. Let's say we have circle. We cut it to 4 'triangles' but longest hand is perfect arc. I want to write some letters on this arc but rotate it to be horizontal always. In other words, how to make clock face with horizontal numbers. It can be any hour, so can be 12-3-6-9, but can be 1-4-7-11 etc. Thanks for suggestions.

POSTED BY: John Cosmic
Posted 5 years ago

The description is not very clear. Do you mean something like this?

numbers = Range[12];
angles = Table[i*2*Pi/12, {i, 1, 12}];
numberAngles = AssociationThread[numbers, angles];
Graphics[{
  Circle[{0, 0}, 10],
  Text[Style[#, 14, Blue, Bold], {9 Sin[numberAngles[#]], 9 Cos[numberAngles[#]]}] & /@ {1, 4, 6, 7, 11}}]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract