coo_chull | R Documentation |
coo_chull
returns the ids of points that define the convex hull of a shape. A simple wrapper
around chull, mainly used in graphical functions.
coo_chull(coo)
## Default S3 method:
coo_chull(coo)
## S3 method for class 'Coo'
coo_chull(coo)
coo_chull_onion(coo, close = TRUE)
## Default S3 method:
coo_chull_onion(coo, close = TRUE)
## S3 method for class 'Coo'
coo_chull_onion(coo, close = TRUE)
coo |
a |
close |
|
coo_chull_onion
recursively find their convex hull,
remove them, until less than 3 points are left.
coo_chull
returns a matrix
of points defining
the convex hull of the shape; a list
for Coo
.
coo_chull_onion
returns a list
of successive onions rings,
and a list
of list
s for Coo
.
Other coo_ descriptors:
coo_angle_edges()
,
coo_angle_tangent()
,
coo_area()
,
coo_boundingbox()
,
coo_circularity()
,
coo_convexity()
,
coo_eccentricity
,
coo_elongation()
,
coo_length()
,
coo_lw()
,
coo_rectangularity()
,
coo_rectilinearity()
,
coo_scalars()
,
coo_solidity()
,
coo_tac()
,
coo_width()
# coo_chull
h <- coo_sample(hearts[4], 32)
coo_plot(h)
ch <- coo_chull(h)
lines(ch, col='red', lty=2)
bot %>% coo_chull
coo_chull_onion
x <- bot %>% efourier(6) %>% PCA
all_whisky_points <- x %>% as_df() %>% filter(type=="whisky") %>% select(PC1, PC2)
plot(x, ~type, eig=FALSE)
peeling_the_whisky_onion <- all_whisky_points %>% as.matrix %>% coo_chull_onion()
# you may need to par(xpd=NA) to ensure all segments
# even those outside the graphical window are drawn
peeling_the_whisky_onion$coo %>% lapply(coo_draw)
# simulated data
xy <- replicate(2, rnorm(50))
coo_plot(xy, poly=FALSE)
xy %>% coo_chull_onion() %$% coo %>%
lapply(polygon, col="#00000022")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.