title: Spirograph Turtle Python
body: <p>How can I play with a turtle and how can I use a turtle?</p>
  <p>I have trouble getting the thing to work as in the picture shown below (ignore the colors).</p>
  <p><img src="https://gyazo.com/caf8e8b6f87bf2c60dd06acb4374d395.png" alt="Image" /></p>
  <pre><code>from turtle import *
  from math import *
  
  
  def formulaX(R, r, p, t):
      x = (R-r)*cos(t) - (r + p)*cos((R-r)/r*t)
  
  def formulaY(R, r, p, t):
      y = (R-r)*sin(t) - (r + p)*sin((R-r)/r*t)
  
  def t_iterating(R, r, p):
      t = 2*pi
      up()
      goto(formulaX, formulaY)
      down()
  
      while (True):
          t = t + 0.01
          formulaX(R, r, p, t)
          formulaY(R, r, p, t)
  
  
  def main():
      R = int(input(&quot;The radius of the fixed circle: &quot;))
      r = int(input(&quot;The radius of the moving circle: &quot;))
      p = int(input(&quot;The offset of the pen point, between &lt;10 - 100&gt;: &quot;))
  
      if p &lt; 10 or p &gt; 100:
          input(&quot;Incorrect value for p!&quot;)
  
      t_iterating(R, r, p)
  
      input(&quot;Hit enter to close...&quot;)
  
  main()'
  </code></pre>
  <p>I am trying to make that kind of shape. Here is the coding I have done so far.</p>