inahull {alphahull}R Documentation

Determine whether a point belongs to the alpha-convex hull

Description

This function determines whether a given point p belongs to the α-convex hull of a sample.

Usage

inahull(ahull.obj, p)

Arguments

ahull.obj Object of class "ahull" returned by the funcion ahull.
p Numeric vector with two components describing a point in the plane.

Details

The complement of the α-convex hull of a sample is calculated by complement. The function inahull checks whether the point p belongs to any of the open balls or halfplanes that define the complement.

Value

in.ahull A logical value specifying whether the point p belongs to the α-convex hull.

See Also

ahull, complement.

Examples

# Random sample in the unit square
x<-matrix(runif(100),nc=2)
# Value of alpha
alpha<-0.2
# alpha-convex hull
ahull.obj<-ahull(x,alpha=alpha)
# Check if the point (0.5,0.5) belongs to the alpha-convex hull
inahull(ahull.obj,p=c(0.5,0.5))

[Package alphahull version 0.1 Index]