trans3d {fields}R Documentation

Converts 3-d coordinates to 2-d plotting coordinates

Description

Uses the projection matrix returned by persp to transform x,y,z values to 2d plotting region.

Usage

trans3d(x, y, z, pmat)

Arguments

x vector of x values
y vector of y values
z vector of z values
pmat projection matrix returned by persp

Value

A list

x values of x coordinate in plotting scale
comp2 values of y coordinate in plotting scale

...

Author(s)

D. Nychka (but really who ever wrote the persp help file)

See Also

persp, drape.plot

Examples

# Mr. R's favorite New  Zealand Volcano!
data( volcano)
M<- nrow( volcano)
N<- ncol( volcano)
x<- seq( 0,1,,M)
y<- seq( 0,1,,N)

persp( x,y,volcano,phi=30, theta=30)-> pm
#point at (.5,.5,.9)
trans3d( .5,.5,180, pm)-> uv
points( uv, pch="o", cex=2, col="red")

# add a contour line 
# 
contourLines( x,y,volcano)[10][[1]]-> out
z<- rep( out$level, length( out$x))
trans3d( out$x, out$y, z, pm)-> uv
lines( uv, col="blue", lwd=2)



[Package fields version 2.3 Index]