ell: Ellipses in 2D

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ell.R

Description

Tools to generate 2D data, concentration and confidence ellipses given a center and a 'variance' matrix. Also tools to generate points on a ellipse in a given direction or conjugate to that direction, axes along a vector or conjugate to it, tangent lines at a point or parallel to a vector.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ell( center, shape, radius = 1, n = 100)



ellpt( ell, dir = c(0,1) , radius = 1 )

ellptc( ell, dir = c(0,1) , radius = 1 )

elltan( ell, dir = c(0,1) , radius = 1 , len = 1, v= c(-1,1))

elltanc( ell, dir = c(0,1) , radius = 1 , len = 1, v= c(-1,1))

ellbox( ell, dir = c(0,1) , radius = 1 )

Arguments

center

the center of the ellipse

shape

a 2 x 2 positive semi-definite. It is the variance matrix of a multivariate normal for which the ellipse is a concentration ellipse.

radius

of the ellipse or point relative to the unit ellipse. For all functions except those generating tangents radius can be a vector. For example, ellpt( ell, c(0,1), radius = c(-1,1)) will generate an axis of the unit ellipse.

n

number of points to generate for the ellipse

ell

is an object of class ell created by ell, dell or cell

dir

vector giving the direction from the center of the ellipse to find a point on the ellipse or a tangent to it, or a direction conjugate to the direction in which ...

len

half 'length' of a tangent vector

v

tangent vector

Details

ell returns a matrix of points on the ellipse, suitable for plotting with lines.

ellpt returns a point on an ellipse particular direction specified by dir

ellptc returns a point on an ellipse in a conjugate direction specified by dir

Value

The functions ell and dell return an object of class ell consisting of matrix whose rows are points on the ellipse and, thus, can be plotted with plot or lines. The other functions return a n x 2 matrix of points to plotted.

Author(s)

Georges Monette

See Also

cell, dell, ell.conj, ~~~

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

  plot( e1 <- ell(c(1,1), matrix(c(1,.6,.6,1), ncol = 2)) )
  ellptc ( e1, radius = c(-1,1))

## End(Not run)

p3d documentation built on May 2, 2019, 5:25 p.m.