The only "secret" is that you are determining the location of the center of the label ... not its upper-left edge ... and "zero degrees" points straight up. The numbers are 360 / 12 = 30 degrees apart. There are 2*pi radians in a circle. The diameter is some known quantity. The X and Y offsets are calculated by cos() and sin().