R365: Day 15 Happy Valentine’s Day!

Image

Have a fun day readers!

dat<- data.frame(t=seq(0, 2*pi, by=0.1) )

xhrt <- function(t) 2*sin(t)^3

yhrt <- function(t) 11*cos(t)-4*cos(2*t)-2*cos(3*t)-cos(4*t)

dat$y=yhrt(dat$t)

dat$x=xhrt(dat$t)

with(dat, plot(x,y, type=”l”))

with(dat, polygon(x,y, col=”hotpink”))

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s