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
New Sketch
By
Muhammed Rashad
Run
import math def part_of_ellips(r,theta): return point(math.sin(theta)*(r),math.cos(theta)*r) points = [point(50,0) ] r = 130 # Width of ellipse # Height of ellipse part = 0.045 # 1 => full ellipse, 0.25 => quarter and so on step = 0.01 # Increase to make ellipse smoother (will take more time) i = 0 while i < (3.14*(part*2)): points.append(part_of_ellips(r,i)) i = i+step # Step size #outerlayer s2=rectangle(h=200,w=200,fill="#FFA500",stroke="none")|repeat(20,rotate(15)) s3=rectangle(h=212,w=212,fill="#DC143C")|repeat(20,rotate(15)) s4=rectangle(h=200,w=200,fill="#FFA500",stroke="none")|rotate(7.5)|repeat(20,rotate(15)) s5=rectangle(h=212,w=212,fill="#DC143C")|rotate(7.5)|repeat(20,rotate(15)) show(s5,s4,s3,s2) #spirallayer color= ["#DC143C", "#f7df05","#f7bf05", "#016b0a", "#800000"] n=15 while n < 361 : for i in color: show(polygon(points,fill=i,stroke="none") | rotate(n)) n=n+15 #innerspiral s1=rectangle(h=150,w=150,fill="#FFA500",stroke="none")|repeat(6,rotate(30)) s2=rectangle(h=150,w=150)|repeat(6,rotate(30)) show(s2,s1) #flower e1=ellipse(h=200,w=80,fill="#880627")|repeat(6,rotate(60)) e2=ellipse(h=250,w=80,fill="#aa0831",stroke="none")|repeat(6,rotate(60))|scale(0.75) e3=ellipse(h=250,w=80,fill="#cc0a3b",stroke="none")|repeat(6,rotate(60))|scale(0.65) e4=ellipse(h=250,w=80,fill="#ee0b45",stroke="none")|repeat(6,rotate(60))|scale(0.55) e5=ellipse(h=250,w=80,fill="#f4295d",stroke="none")|repeat(6,rotate(60))|scale(0.45) flower=combine([e1,e2,e3,e4,e5]) show(flower|scale(0.86)) #innerlayer c1=circle(r=15,fill="#FFFFE0",stroke="none") c2=circle(r=25,fill="#f7bf05",stroke="none") c3=circle(r=35,fill="#FFA500",stroke="none") c4=circle(r=45,fill="#DC143C",stroke="none") c5=circle(r=52.5,fill="#800000",stroke="none") c6=circle(r=130) show(c6,c5,c4,c3,c2,c1)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login