今天在微博上看到这坑爹的方程: $ (x^2+y^2-1)^3 = {x^2} {y^3}$

画出来如下:

跟个屁股似的,sigh…

翻出azalea的老文:http://azaleasays.com/2008/06/18/fomula-of-love/

用ggplot2画一下这个爱的方程:$17x^2-16|x|y+17y^2 = 225 $

x <- seq(-sqrt(17), sqrt(17), 0.001)
y1 <- 8*abs(x)/17 + 15* sqrt(17 - x^2)/17
y2 <- 8*abs(x)/17 - 15* sqrt(17 - x^2)/17
d <- data.frame(x=c(x,x),y=c(y1,y2))
require(ggplot2)

p <- ggplot(d, aes(x,y))
p + geom_point(color="red")

还可以画出红心,适合今天七夕的日子。

p + geom_line(color="red")

画函数图,这种事情,还是用CAS方便点。

通过maxima来画,一条指令就行,还不用解方程:

contour_plot(17*x^2-16*abs(x)*y+17*y^2-225, [x,-sqrt(17),sqrt(17)],[y,-15*sqrt(17)/17, sqrt(17)])