title: Having trouble with the the turtle module to draw the Spiral of Theodorus
body: <p>One of the problems for my programming assignment is to use the turtle module to draw the <a href="https://en.wikipedia.org/wiki/Spiral_of_Theodorus" rel="nofollow">Spiral of Theodorus</a>! with 
  n = 17. </p>
  
  <p>I've got all the code done but whenever it the scale of the drawing is super off. For example in the first triangle with the dimensions sqrt(1), 1, sqrt(2) the triangle would be a 45, 45 triangle, but in turtle 1 = 1 pixel and that would illegible so i would have to use a larger number such as 100, but if i use 100 then the dimensions for the 1st triangle would be sqrt(100), 100, sqrt(200). which is not the same triangle proportionally.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>def TheodorusSpiral(myTurtle,n,d):
      import math
      myTurtle=turtle
      myTurtle.pu()
      myTurtle.home()
      myTurtle.pd()
      myTurtle.fd(d)
      myTurtle.lt(90)
      myTurtle.fd(d)
      myTurtle.lt(45)
      for i in range(n-1):
          a = (i+2)*d
          c = math.fabs(d*math.sqrt(a))
          angle = math.degrees(math.atan(c/d))
          angle2 = math.degrees(math.atan(d/d*math.sqrt(a+1)))
          angle3 = math.degrees(math.atan(d*math.sqrt(a+1)/d))
          angle4 = 180 - (angle2 + angle3)
          angle5 = 180 -(angle + angle4)
          myTurtle.fd(d)
          myTurtle.lt(angle5)
  
  
  
  TheodorusSpiral(1,4,50)
  </code></pre>
  
  <p>Also another problem i have is that when i call the function, for the parameter "myTurtle" i can't call it with a name/letter such as "tim".</p>
  
  <p>For example TheodorusSpiral(tim,4,50) would give me the error </p>
  
  <blockquote>
    <p>" tim is not defined"</p>
  </blockquote>