Question: Valentine Cardioid Lemniscate

Its close to Valentine's Day on the 14th Feb.  I was hoping to combine the lemniscate and cardiod curves to make a decorative heart shaped "valentine".     Inn polar form the cardioid is r=2R(1 - cos theta)   and the lemniscate r=L*sqrt(cos(2*theta)

  However these are not with respect to the same origin:-(

Any suggestions please?

 

restart:

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

#  Lemniscate - Cardioid - Valentine

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

with(plots):

with(plottools):

#Lemniscate

pl1:=plot(sqrt(cos(2*x)),x=0..Pi/2, coords=polar, scaling=constrained):

#Cardioid

pl2:=plot(1-cos(x),x=0..3*Pi/4, coords=polar, scaling=constrained):

#pp1:=pointplot({seq([x/100,sqrt(cos(2*x/100))],x=0..150)});

##pp1:=seq(pointplot( {  [x/100,sqrt(cos(2*x/100)) ],x=0..150}) );

plots[display](pl1, pl2);

#l := {  seq(   point(  [x/100,sqrt(cos(2*x/100))]  ),x=0..150   )  }:

#l := {     point(  [0/100,sqrt(cos(2*0/100))]  ),point(  [2/100,sqrt(cos(2*2/100))]  ),point(  [4/100,sqrt(cos(2*4/100))]  )     }:

L:=11.30:R:=1.538:ext:=.2:

il:=floor(Pi*26-5);

#Lemniscate

#Equation of lemniscate in polar form is r=L*sqrt(cos(2*theta))

 

l:={seq(point([ext+cos(i/100),L*sqrt(cos(2*i/100))*sin(i/100)]),i=-78..il)}:

 

#Cardioid

#Equation of cardioid is r=2*R*(1-cos(theta))

#lc :={seq(  point(  [i/100,2*R*(1-cos(i/100))]  ), i=-ilast..ilast+30  )  }:

 

lc:={seq(point([cos(i/100),2*R*(1-cos(i/100))*sin(i/100)]),i=-4*il/3..il/4  )}:

 

 

plots[display](l,lc, axes=normal, scaling =constrained);

#l := point([0,0], color=green):

#plots[display](l, axes=boxed);

 

 

##pointplot({seq([n,sin(n/10)],n=0..30)});

 

 

printf("             Lemniscate                    Cardioid\n");

 

#ibeg:=convert(-4*il/3, float): iend:=il/4:

ibeg:=  -78:  #floor(-4*il/3):

iend:=floor(il/4):

 

for i from ibeg to iend do

#whattype(i);

xl:=evalf(ext+cos(i/100)): yl:=evalf(L*sqrt(cos(2*i/100))*sin(i/100)):

rr:=evalf(  L*sqrt(  cos(2*i/100)  )):

 

yc:=2*R*(1-cos(i/100))*sin(i/100):

rrc:=2*R*(1-cos(i/100)):

#  printf(" i = %d \n",i);

if type(xl, nonreal) or type(yl, nonreal) then

   printf("i=%d   xl or yl are not real\n", i);

                                          else  

 printf("i=%d   x=%4.3f   y=%4.3f r=%4.3f      yc=%4.3f  r_card=%4.3f\n",i, xl,yl,rr, yc, rrc);

end if;

end do:

Please Wait...