I have the following function
f(x,y) = 2 x^2 + 12 x * y + 7 y^2
And I would like to plot a 3-d graph in R? I am wondering if this is could be done. So I looked on the internet and tried the code below, but nothing was drawn. Could someone point out what is wrong please ?
x <- seq(-100,100,0.1)
y <- seq(-100,100,0.1)
z <- 2*x^2 + 12 * x * y + 7 * y^2
xyz <- data.frame(cbind(x,y,z))
names(xyz) <- c('x', 'y', 'z')
library(lattice)
wireframe(z ~x*y, data = xyz, scales = list(arrows = FALSE), zlab = 'f(x,y)', drape = T)