Learn R Programming

gellipsoid (version 0.7.3)

ell3d: Plot Generalized Ellipsoids in 3D using rgl

Description

ell3d is a convenience wrapper for ellipsoid specialized for class "gell" objects. It plots an ellipsoid in the current rgl window.

Usage

ell3d(x, ...)

# S3 method for default ell3d(x, shape, radius = 1, segments = 40, shade = TRUE, wire = FALSE, ...)

# S3 method for gell ell3d( x, length = 10, sides = 30, segments = 40, shade = TRUE, wire = FALSE, ... )

Value

Returns the result of the call to ellipsoid

Arguments

x

A vector of length 3 giving the center of the ellipsoid for the default method, or a class "gell" object for the gell method.

...

Other arguments, passed to ellipsoid

shape

A 3 x 3 symmetric matrix giving the shape of the ellipsoid.

radius

radius of the ellipsoid

segments

number of segments in each direction in calculating the mesh3d object

shade

Logical. Whether the 3D ellipsoid should be shaded

wire

Logical. Whether the 3D ellipsoid should be rendered with its wire frame

length

For unbounded, (infinite) ellipsoids, the length to display for infinite dimensions

sides

For unbounded, cylindrical ellipsoids, the number of sides for the elliptical cross sections

Author

Georges Monette

See Also

ellipsoid, gell

Examples

Run this code

# a proper ellipsoid, and its inverse
c1 <- c(0,0,0)
C1 <- matrix(c(6, 2, 1,
               2, 3, 2,
               1, 2, 2), 3,3)

open3d()
zell1 <- gell(center=c1, Sigma=C1)
E1 <- ell3d(zell1, col="blue", alpha=0.1)
# inverse of C1
E1I <- ell3d(dual(zell1), col="blue", alpha=0.1, wire=TRUE)

#open3d()  ## to see this in a new window
# a singular ellipsoid and its inverse
c2 <- c1
C2 <- matrix(c(6, 2, 0,
               2, 3, 0,
               0, 0, 0), 3,3)

E2 <- ell3d( zell2 <-gell( center = c2, Sigma = C2), 
             col = 'red', alpha = 0.25, wire = TRUE)
E2I <- ell3d( dual(gell( center = c2, Sigma = C2)), 
             length=3, col = 'red', alpha = 0.25, wire = TRUE )

# signatures
signature(zell1)
signature(zell2)


Run the code above in your browser using DataLab