This is an easy trig problem!
Here let me explain how this works.
Let’s let the variable aac (angle around circle) determine a 2d rotation (y axis… spinning the circle) around the middle of the circle. We should shape an equation that utilizes aac.
If you get out a piece of paper and draw your circle, then draw a right triangle like so…
We can let H be our distance from the center of our big circle. Let’s call this by proper terms, radius of the big circle.
We can let angle a be our rotation around the circle. We should set this to aac variable, because thats our angle around circle variable. Like always, a right triangle has a 90 point. Angle b will be of no use to us.
o stands for opposite. This is the opposite side of our triangle. side a stands for adjacent, please note that there are two a’s because angle a and b are alpha and beta. side a is adjacent side.
Since we have all that we need to find another component on this triangle, we can calculate.
Let’s say the raidus of this big circle, h, is 1. We will use the sine function here. You can check which one you need by soh cah toa. Sine deals with opposite and hypotenuse, cosine with adjacent and hypotenuse and tangent with opposite and adjacent.
sin(angle) = o / h
We know the angle is aac and hypotenuse so…
sin(aac) = o / 1
Do a little function rearranging - multiply h over…
sin(aac) * 1 = o
Then there you go, you have your y axis translation from the middle of your circle. Now we need the x axis, which is the adjacent side. To do this, we need cosine.
cos(angle) = a / h
We know the angle is aac and hypotenuse so…
cos(aac) = a / 1
Do a little function rearranging - multiply h over…
cos(aac) * 1 = a
Then there you go, you have your x axis translation from the middle of your circle.
Box.x = cos(aac) * 1
Box.y = sin(aac) * 1
Also, note that aac has to be in RADIANS. So… math.rad(aac). We have aac in degrees.
Then all you need to do is rotate it to look at the center. If you don’t know how to do this, ask and I will continue.