Quader {SoPhy} | R Documentation |
Simple functions that plot points in a perspective view
belichtet(x, radius=1, fix.scale=TRUE, correction=1.2) pos3D(x, inf) quader(size, inf, sun, bottomleftfront= c(0,0,0), col=grey(seq(1,0,-0.001)), col.frame=c("grey", "black"), lty=c(2,1), cex.axis=1.5, reverse=TRUE, unit = "cm", add=FALSE, plot=TRUE, font = c("sans serif", "bold"), srt=NULL)
x |
matrix of three rows; the three dimensional coordinates |
radius |
radius of the dyed tube around each path; the tube is approximated by a sequence of balls |
fix.scale |
logical. If FALSE
the plotted radius is modified according to the perspective distance
|
correction |
positive real number. Do not change its value. This constant takes into account that the plotting procedure used in the function does not plot a circle of exactly the given radius. |
inf |
Vector of three components. The first two give the position
of the infinitely far point; the third component gives the extension
factor for the second dimension that is orthogonal to the screen;
inf is of order 1/100 |
size |
dimension of the quader |
sun |
the three dimensional coordinates of the fictive sun |
bottomleftfront |
location of the quader; the standard is that the quader is in the first quadrant with one vertice in the origin |
col |
vector of colours; the point that is nearest to the sun
gets the colour col[1] , the one that is the furthest away
rev (col)[1] .
|
col.frame |
vector of two components.
The edges that are visible get colour
col.frame[2] the others col.frame[1] |
lty |
vector of two components. the edges that are visible have
line type lty[2] the others lty[1] |
cex.axis |
The magnification to be used for axis annotation
relative to the current, see par |
reverse |
logical. If TRUE the z-axis is numbered
upside down |
unit |
|
add |
logical. If TRUE , a quader is added to current figure |
plot |
logical. If FALSE only the values for the
coordinate system are calculated and stored in the background,
which will be used by belichtet , for example.
|
font |
font used for the labelling of the axes, see also
font |
srt |
angle for the character rotation when labelling the y axis;
if NULL the angle is calculated, but might be not always the
best choice.
|
The function quader
must be called first with add=FALSE
.
quader
plots a perspective quader and provides global variables
whose name starts with .p3d
.
If, for the second time, quader
is called solely by the argument
add=TRUE
, the original quader is redrawn.
The auxiliary function pos3D
calculates the two-dimensional
projected positions of the three dimensional points. If inf
is
not given, the one given in quader
is used.
belichtet
plots the three dimensional points in perspective view.
The functions belichtet
and quader
return NULL
,
the function pos3D
returns a matrix of 2 rows and
ncol(x)
coloumns.
Martin Schlather, martin.schlather@math.uni-goettingen.de http://www.stochastik.math.uni-goettingen.de/institute
f <- function(x) cos((x[2,] + x[1, ]) / 5) + cos((x[2, ]-x[3,]) / pi + 3) + cos(x[3, ] / 2 + 2) x <- t(expand.grid(1:50, 1:100, 1:50)) y <- x[, f(x)>0.5] quader(size=c(50, 100, 50), inf=c(150, -400, 1/500), sun=c(200, -30000, 50)) belichtet(y) quader(add=TRUE, col.frame=c("transparent", "black"))