Completa i seguenti comandi di R in modo da ottenere la figura a lato. | |
source("http://macosa.dima.unige.it/r.R") f <- function(x,y) 144*(x^4+y^4)+350*x^2*y^2-225*(x^2+y^2)+81 g <- function(x,y) (x^2-1)^2-y^2*(2*y+3) x <- function(t) (cos(t)-(sin(t)^2)/sqrt(2)) y <- function(t) sin(t)*cos(t) |
Le curve sono note come "fish curve", "knot curve", "Trott curve" (qual è il nome di ciascuna curva?). Ecco come si potevano completare i comandi:
source("http://macosa.dima.unige.it/r.R")
PLANE(-1.5,1.5, -1.5,1.5)
f <- function(x,y)
144*(x^4+y^4)+350*x^2*y^2-225*(x^2+y^2)+81
CURV(f,"brown")
g <- function(x,y) (x^2-1)^2-y^2*(2*y+3)
CURV(g,"red")
x <- function(t) (cos(t)-(sin(t)^2)/sqrt(2))
y <- function(t) sin(t)*cos(t)
param(x,y,0,2*pi,"blue")