# SELECT ALL and PASTE in R # # For other images write thphdi(teta, fi, di) # z0 <- c(-0.1,6); u <- c(z0[1],z0[1],z0[1],z0[1]); z <- array(u,dim=c(2,2)) # in u metto il val. minimo di z x <- c(-4,1-1/2); y <- c(-1.5,2-1/2) thphdi <- function(t,p,di) { par( mai = c(0.1,0.1,0.1,0.1) ) # riduco i margini F <- persp(x,y,z,theta=t,phi=p,scale=FALSE,zlim=z0, xlim=x,ylim=y,d=di,box=FALSE,border="white") points(trans3d(-100000,0,0,pmat=F)) points(trans3d(-100000,-100000,0,pmat=F)) points(trans3d(0,-100000,0,pmat=F)) points(trans3d(10,-10,0,pmat=F)) points(trans3d(-1,-999,501,pmat=F)) points(trans3d(-1999,-999,501,pmat=F)) lines(trans3d(c(-1,-1,1,1,-1),c(-1,1,1,-1,-1),c(0,0,0,0,0),pmat=F)) lines(trans3d(c(-1,-1),c(-1,-1),c(0,1),pmat=F)) lines(trans3d(c(1,1),c(-1,-1),c(0,1),pmat=F)) lines(trans3d(c(-1,-1),c(1,1),c(0,1),pmat=F)) lines(trans3d(c(1,1),c(1,1),c(0,1),pmat=F)) lines(trans3d(c(-1,1),c(-1,-1),c(1,1),pmat=F),col="red") lines(trans3d(c(-1,1),c(1,1),c(1,1),pmat=F),col="red") lines(trans3d(c(1,1),c(1,0),c(1,1.5),pmat=F),col="brown") lines(trans3d(c(1,1),c(-1,0),c(1,1.5),pmat=F),col="brown") lines(trans3d(c(-1,-1),c(-1,0),c(1,1.5),pmat=F),col="red") lines(trans3d(c(-1,-1),c(1,0),c(1,1.5),pmat=F),col="red") lines(trans3d(c(1,-1),c(0,0),c(1.5,1.5),pmat=F),col="red") lines(trans3d(c(1,1),c(-0.2,-0.2),c(0,0.7),pmat=F),col="brown") lines(trans3d(c(1,1),c(0.2,0.2),c(0,0.7),pmat=F),col="brown") lines(trans3d(c(1,1),c(-0.2,0.2),c(0.7,0.7),pmat=F),col="brown") lines(trans3d(c(0,0),c(0,0),c(0,1.5),pmat=F),col="blue",lty=3) lines(trans3d(c(0,1.5),c(0,0),c(0,0),pmat=F),col="blue",lty=3) lines(trans3d(c(0,0),c(0,1.5),c(0,0),pmat=F),col="blue",lty=3) lines(trans3d(c(1,1),c(-1,100000),c(0,0),pmat=F),col="green4",lty=3) lines(trans3d(c(1,1),c(1,-100000),c(1,1),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-1),c(1,-100000),c(1,1),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-1),c(-1,100000),c(0,0),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-100000),c(1,1),c(0,0),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-100000),c(1,1),c(1,1),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-100000),c(-1,-1),c(0,0),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-100000),c(-1,-1),c(1,1),pmat=F),col="green4",lty=3) lines(trans3d(c(1,-100000),c(1,-100000),c(0,0),pmat=F),col="green4",lty=3) lines(trans3d(c(1,-100000),c(1,-100000),c(1,1),pmat=F),col="green4",lty=3) lines(trans3d(c(-100000,0),c(0,-100000),c(0,0),pmat=F),col="orange",lty=3) lines(trans3d(c(1,-1999),c(1,-999),c(1,501),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-1),c(1,-999),c(1,501),pmat=F),col="green4",lty=3) lines(trans3d(c(-1,-100000),c(-999,0),c(501,0),pmat=F),col="orange",lty=3) } ### thphdi(133,10,0.01) # Try also with thphdi(133,5,0.01) thphdi(133,0,0.01) thphdi(133,-5,0.01) # thphdi(125,-5,0.01) # An example related to a photograph (G is the sun):