Explore
Courses
Batches
Sketches
Statistics
Code a Pookkalam
Jobs
Devsprint
People
Course Creation
Create a Course
Guidelines
Resources
Support
Blogs
My Profile
About Us
Login
Sketches
0
Spiral
By
Hardik Prajapati
Run
def spiral(diff=10): r = 0 shape = line(x1=0, y1=0, x2=diff, y2=0) while(r < 300): r += diff if ((r // diff) % 2 == 1): x = 0 y = r//2 else: x = diff y = -r//2 shape += line(x1=x+r, y1=y*2, x2=x-r, y2=y*2) shape += line(x1=x+r, y1=0, x2=x+r, y2=y*2) shape += line(x1=x-r, y1=0, x2=x-r, y2=y*2) return shape s1 = spiral() | rotate(45) show(s1)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login