« In case you missed it: January 2013 Roundup | Main | Video: Data Mining with R »

February 14, 2013

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a010534b1db25970b017ee884c7ba970d

Listed below are links to weblogs that reference Make a Valentine's Heart with R:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

For an alternate parameterization (with a more pointy bottom) see my Valentine to my spouse. I also include some math-geeky phrases of affection, such as "You are more beautiful than Euler's identity!"

Saw this great solution on Stackoverflow: http://stackoverflow.com/questions/8082429/plot-a-heart-in-r

```
dat<- data.frame(t=seq(0, 2*pi, by=0.1) )
xhrt <- function(t) 16*sin(t)^3
yhrt <- function(t) 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)
dat$y=yhrt(dat$t)
dat$x=xhrt(dat$t)
plot(y ~ x, data=dat, type="l", bty="n", xaxt="n", yaxt="n", ann=FALSE)
with(dat, polygon(x,y, col="hotpink"))
points(c(10,-10, -15, 15), c(-10, -10, 10, 10), pch=169, font=5)
```

The comments to this entry are closed.


R for the Enterprise

Got comments or suggestions for the blog editor?
Email David Smith.
Follow revodavid on Twitter Follow David on Twitter: @revodavid

Search Revolutions Blog