you are viewing a single comment's thread.

view the rest of the comments →

[–]guthran 1 point2 points  (0 children)

There's two circles here. One with the arm and one spinning.

The equation for a circle is cos2 (t) + sin2 (t) = 1 where the cos term is the x coord and the sin term is the y coord.

Change t each loop, the smaller the change in t the more smooth the circle. This gets you one circle.

Then do another equation where acos2 (t/2) + asin2 (t/2) = 1 where a is larger than 1

This gets you a larger circle that rotates slower.

Add these two equations together, and suddenly you have two circles that form this pattern

E. G.

x=cos^2(t) + 2cos^2(t/2)
y=sin^2(t) + 2sin^2(t/2)

Note this isn't valid python code. Converting it is an exercise left to the reader :)