source("http://macosa.dima.unige.it/r.R") # le coordinate dei due pesci, mettendo di fila le coppie x,y pesce1 <- c( 0.0,-0.40, 0.0,-0.35, 0.2,-0.15, 0.2,0.05, 0.0,0.20, 0.0,0.30, 1.0,0.95, 2.5,1.50, 4.0,1.80, 5.0,1.90, 6.0,1.75, 7.0,1.40, 8.0,1.05, 8.8,0.70, 9.4,1.00, 9.5,1.30, 9.4,1.90, 9.0,2.00, 8.0,1.05, 8.8,0.70, 10.0,0.05, 10.0,-0.25, 11.2,-0.70, 11.3,-0.30, 11.3,0.00, 11.2,0.40, 10.0,0.05, 10.0,-0.25, 9.0,-0.60, 8.0,-1.00, 8.5,-2.00, 9.0,-2.15, 9.6,-2.00, 9.8,-1.50, 9.0,-0.60, 8.0,-1.00, 6.6,-1.70, 5.0,-2.20, 4.0,-2.25, 3.0,-2.20, 2.0,-2.00, 1.4,-1.60, 0.6,-0.80, 0.0,-0.40) pesce2 <- c( 0.0,-0.40, 0.0,-0.35, 0.1,-0.15, 0.1,0.05, 0.0,0.20, 0.0,0.30, 0.5,0.95, 1.25,1.50, 2.0,1.80, 2.5,1.90, 3.0,1.75, 3.5,1.40, 4.0,1.05, 4.4,0.70, 4.7,1.00, 4.75,1.30, 4.7,1.90, 4.5,2.00, 4.0,1.05, 4.4,0.70, 5.0,0.05, 5.0,-0.25, 5.6,-0.70, 5.65,-0.30, 5.64,0.00, 5.6,0.40, 5.0,0.05, 5.0,-0.25, 4.5,-0.60, 4.0,-1.00, 4.25,-2.00, 4.5,-2.15, 4.8,-2.00, 4.9,-1.50, 4.5,-0.60, 4.0,-1.00, 3.3,-1.70, 2.5,-2.20, 2.0,-2.25, 1.5,-2.20, 1.0,-2.00, 0.7,-1.60, 0.3,-0.80, 0.0,-0.40) # quanti sono i punti n1 <- length(pesce1)/2; n1 n2 <- length(pesce2)/2; n2 BF=2; HF=2 X <- xTab(pesce1); Y <- yTab(pesce1) ## A boxmN(0,12, -6,6) A <- seq(0,12,0.1); A1 <- seq(0,12,1) B <- seq(-3,3,0.1); B1 <- seq(-3,3,1) for(x in A) for (y in B1) punticino(x,y, 3) for(x in A1) for (y in B) punticino(x,y, 3) spezzaC(X,Y, 8); spezzata(X,Y, 1) cerchio(1.1,0.5, 1/7, 1) ## B boxmN(-1,7, -4,4) f1x=function(x,y) x/2 f1y=function(x,y) y X1 = f1x(X,Y); Y1 = f1y(X,Y) for(x in A) for (y in B1) punticino(f1x(x,y),f1y(x,y), 3) for(x in A1) for (y in B) punticino(f1x(x,y),f1y(x,y), 3) spezzaC(X1,Y1, 8); spezzata(X1,Y1, 1) cerchio(f1x(1.1,0.5),f1y(1.1,0.5), 1/7, 1) ## C boxmN(-1,7, -4,4) f2x=function(x,y) x+y*0.4 f2y=function(x,y) y X2 = f2x(X1,Y1); Y2 = f2y(X1,Y1) for(x in A) for (y in B1) punticino(f2x( f1x(x,y),f1y(x,y) ),f2y( f1x(x,y),f1y(x,y )), 3) for(x in A1) for (y in B) punticino(f2x( f1x(x,y),f1y(x,y) ),f2y( f1x(x,y),f1y(x,y) ), 3) spezzaC(X2,Y2, 8); spezzata(X2,Y2, 1) cerchio(f2x(f1x(1.1,0.5),f1y(1.1,0.5)),f2y(f1x(1.1,0.5),f1y(1.1,0.5)), 1/7, 1) ## D boxmN(0,14, -7,7) f3x=function(x,y) x-(abs(y)/10)^1.15 f3y=function(x,y) abs((1+x^1.4/10)*y)^1.001*sign(y) X3 = f3x(X,Y); Y3 = f3y(X,Y) for(x in A) for (y in B1) punticino(f3x(x,y),f3y(x,y), 3) for(x in A1) for (y in B) punticino(f3x(x,y),f3y(x,y), 3) spezzaC(X3,Y3, 8); spezzata(X3,Y3, 1) cerchio(f3x(1.1,0.5),f3y(1.1,0.5), 1/7, 1)