This function generates a 3D display of the cusp equilibrium surface.
cusp3d.surface(alpha = c(-5, 5), beta = c(-3, 3), y = 41,
xlim = range(alpha), ylim = range(beta), zlim = c(-5, 4),
xlab = expression(alpha), ylab = expression(beta), zlab = "equilibrium states",
main = NULL, sub = NULL, phi = 20, theta = 160,
r = sqrt(3), d = 1, scale = TRUE, expand = 1, hue = 240,
chroma = 35, surf.alpha = 0.75, gamma = 1.5, bcol = NA,
lcol = "gray", ltheta = 90, lphi = 70, box = TRUE,
axes = FALSE, nticks = 5, ticktype = "simple", floor.lines = TRUE, ...)
cusp3d.surface
returns the viewing transformation matrix, say VT
, a 4 x 4 matrix suitable for projecting 3D coordinates (x,y,z) into the 2D plane using homogeneous 4D coordinates (x,y,z,t). It can be used to superimpose additional graphical elements on the 3D plot, by lines() or points(), using the simple function trans3d().
numeric 2-vector specifying the normal/symmetry factor axis range
numeric 2-vector specifying the bifurcation/splitting factor axis range
numeric specifying the iso contours used to render the surface (see details below)
numeric 2-vectors (see persp
)
strings (see persp
)
numeric, determine viewing direction (see persp
)
numeric, distance to center of the plotting box (see persp
)
numeric, strength of perspective transformation (see persp
)
logical, see persp
hue, chroma and alpha (transparency) of the surface segments (see hcl
)
gamma for shading of surface (see cusp3d
)
color, NA
, or string "surface"
. Color of the border of each surface element; NA
gives transparent borders; "surface"
tries to hide the border as much as possible by giving it the same color as the surface segment.
color of the lines on the floor of the plotting cube
numeric, direction of illumination of the surface (similar to persp
)
(see persp
)
logical, if TRUE
(default) iso-contours are projected on the floor of the plotting cube (revealing the bifurcation set)
Raoul Grasman
If y
has length 1, it is interpreted as the number of contours. Otherwise it is interpreted as a vector of contour levels from which the surface must be determined. If y
is a number, the exact range of y
is determined by the ranges of alpha
and beta
through the cusp equilibrium equation below.
The surface is constructed from the iso-contours of the cusp equilibrium surface that makes up the solutions to $$\alpha + \beta*y - y^3 = 0$$
as a (multi-)function of the asymmetry variable \(\alpha\) and bifurcation variable \(\beta\). For each possible solution \(y\) the iso-contours are given by the equation $$\alpha = (\beta*y - y^3)/y,$$ which are linear in \(\beta\). For each value of \(y\) the values of \(alpha\) are determined for the end points of the \(beta\) range specified by beta
. The two 3D coordinates (\(\alpha\), \(\beta\), \(y\)) are projected onto the 2D canvas using the persp
transformation matrix and used for drawing the lines and polygons.
See cusp-package
, cusp3d
persp
, plot.cusp
if (FALSE) {
p = cusp3d.surface(chroma=40,lcol=1,surf.alpha=.95,phi=30,theta=150,
bcol="surface",axes=TRUE,main="Cusp Equilibrium Surface")
lines(trans3d(c(5,5), c(3,3), c(-5,4), p), lty=3) # replot some of the box outlines
lines(trans3d(c(-5,5), c(3,3), c(4,4), p), lty=3)
}
Run the code above in your browser using DataLab