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
al_vazha
Run
import math def cardiod(a,type=0,x=0,y=0): #type 0: 2a(1-cos(t)) #type 1: 2a(1+cos(t)) mirror |y #type 2: 2a(1-sin(t)) up #type 3: 2a(1+sin(t)) mirror | x cardiod=[] for i in range(360): c_t=math.cos(i) s_t=math.sin(i) if type==0: eq_f=-1*c_t elif type==1: eq_f=c_t elif type==2: eq_f=-1*s_t elif type==3: eq_f=s_t cood_x=(2*a*(1+eq_f)*c_t)+x cood_y=(2*a*(1+eq_f)*s_t)+y cardiod.append([cood_x,cood_y]) coordinates=[] for ele in cardiod: coordinates.append(point(ele[0],ele[1])) p=polygon(coordinates) return p for j in range(0,61,30): for k in range(60): show(cardiod(4,type=0,x=-20-j,y=0)|rotate(30*k))
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login