Learn R Programming

dga (version 2.0.1)

ellipse.ind: A Helper Function Used by Venn4

Description

Takes potential points to be plotted in the venn diagrams and returns whether the point is inside or outside of the ellipse described by x, y, a, b, and alpha.

Usage

ellipse.ind(ps, x, y, a, b, alpha)

Arguments

ps

a n x 2 matrix of coordinates.

x

the x coordinate of the center of the ellipse.

y

the y coordinate of the center of the ellipse.

a

the x-radius of the ellipse.

b

the y-radius of the ellipse.

alpha

the angle of rotation of the ellipse

Value

a length n vector indicating whether each point is inside the ellipse.

Examples

Run this code
# NOT RUN {


## The function is currently defined as
ps <- cbind(runif(100), runif(100))
plot(dga:::ellipse(0, 0, .5, .3, 0), type = "l")
inds <- dga:::ellipse.ind(ps, 0, 0, .5, .3, 0)
points(inds)
# }

Run the code above in your browser using DataLab