Python Forum
Radial lines using turtle help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Radial lines using turtle help
#1
def draw_line(t, x, y, angle, length):
    t.up()
    t.setx(x)
    t.sety(y)
    t.seth(angle)
    t.pd()
    t.fd(length)
    t.up()
This is my function for a line using the turtle graphics import
I'm supposed to write a new function using my hold function and a for loop to
[Image: ?ui=2&view=btop&ver=c43mbs7rgbo#attid%25...bad4576273]

I'm not even sure how to start, could someone help walk me through this? Thanks in advance
Reply
#2
You would need a for loop, over a range of the number of radial lines you need. Each time through the loop you would call the function you posted. The x, y, and length parameters would always be the same. The angle would be the loop variable times 360 / number of radial lines.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020