# The Earth and the route longitude = latitude ("y = x") # I reduce the margins of the picture: par( mai = c(0.2,0.2,0.2,0.2) ) # A partition of [0,2*pi] t <- seq(0,2*pi,len=200) z0 <- c(-1,1); u <- rep(z0[1],4) z <- array(u,dim=c(2,2)); x <- c(-1,1); y <- c(-1,1) # In x,y,z,z0 I defined the box. Now I choose the point of view and define the figure trace <- function(x,y,z,z0,th,ph,di) { F <- persp(x,y,z,theta=th,phi=ph,scale=TRUE,zlim=z0,xlim=x,ylim=y,d=di,border="white",box=FALSE) # equator lines(trans3d(cos(t),sin(t),0,pmat=F),col="blue",lwd=2) # merdian of long. 0 lines(trans3d(cos(t),0,sin(t),pmat=F),col="brown",lwd=2) # parallel for (ang in seq(-90,90,len=10)*pi/180) lines(trans3d(cos(ang)*cos(t),cos(ang)*sin(t),sin(ang),pmat=F),col="red",lty=3) # merdians for (ang in seq(0,170,len=10)*pi/180) lines(trans3d(cos(ang)*cos(t),sin(ang)*cos(t),sin(t),pmat=F),col="red",lty=3) # route longitude = latitude ang <- seq(-90,90,len=200)*pi/180 lines(trans3d(cos(ang)*cos(ang),cos(ang)*sin(ang),sin(ang),pmat=F),col="black",lwd=2) } # I draw the figure from theta=80°,phi=20°,distance=1 trace(x,y,z,z0,80,20,1) # # from another point of view trace(x,y,z,z0,80,90,20) # from another point of view trace(x,y,z,z0,90,0,20)