Learn R Programming

geophys (version 1.4-1)

PLOTplane: Plot Plane on box

Description

Plot Plane on box

Usage

PLOTplane(Rp, planecol = "brown")

Arguments

Rp

Rotated points

planecol

color for plotting plane

See Also

pstart, PLOTbox, stress

Examples

Run this code
# NOT RUN {
#######    set colors
 axcol = 'black'
 boxcol = 'blue'
 planecol = 'brown'

####   view angle
 Rview  =    RFOC::ROTZ(-130) 
# }
# NOT RUN {
<!-- %*% RFOC::ROTX(-50)  -->
# }
# NOT RUN {
###   set arbitrary scale
    xscale = 100


####   set three points and combine them with rbind
     P1 = xscale*c(.2, 1,1,0)
    P2 = xscale*c(1, .1,1,0)
    P3 = xscale*c(1, 1,.4,0)

    PPs = rbind(P1, P2, P3)
    
  ###  convert points for view
Rp = PPs  
# }
# NOT RUN {
<!-- %*% Rview -->
# }
# NOT RUN {
###   create box  and scale it
   BOX <-matrix(c(0,0,0,0,
            0, 1, 0,0,
            0, 1, 1,0,
            0, 0, 1,0,
            1,0,0,0,
            1, 1, 0,0,
            1, 1, 1,0,
            1, 0, 1,0), ncol=4, byrow=TRUE)


    BOX = xscale*BOX

    ##############   create axes and scale them
AX = matrix(c(0,0,0,0,
            1, 0, 0,0,
            0, 0, 0,0,
            0, 1, 0,0,
            0,0,0,0,
            0, 0, 1,0), ncol=4, byrow=TRUE)

    AX = 1.5*xscale*AX

 ##############   rotate axes and box
    Rax =  AX 
# }
# NOT RUN {
<!-- %*% Rview -->
# }
# NOT RUN {
    
          Rbox =   BOX 
# }
# NOT RUN {
<!-- %*% Rview -->
# }
# NOT RUN {
 ##############  start the figure
pstart(xscale=xscale)
 ######  plot the box
PLOTbox(Rax, Rbox, axcol= 'black', boxcol= 'blue')
 ##############  plot the plane
PLOTplane(Rp)

     P1 = xscale*c(0, 0,.4,0)
    P2 = xscale*c(0.8, 0,0,0)
    P3 = xscale*c(0, .7, 0 ,0)

    PPs = rbind(P1, P2, P3)
    
  ###  convert points for view
Rp = PPs  
# }
# NOT RUN {
<!-- %*% Rview -->
# }
# NOT RUN {
PLOTplane(Rp, planecol = "gold" )


# }

Run the code above in your browser using DataLab